All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jivesoftware.smackx.debugger.android.AndroidDebugger Maven / Gradle / Ivy

Go to download

Smack for Android. All the required dependencies to run Smack on Android. Usually you want to add additional dependencies like smack-tcp, smack-extensions and smack-experimental.

There is a newer version: 4.5.0-beta5
Show newest version
/**
 *
 * Copyright © 2014-2021 Florian Schmaus
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jivesoftware.smackx.debugger.android;

import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.debugger.AbstractDebugger;

import android.util.Log;

/**
 * Very simple debugger that prints to the android log the sent and received stanzas.
 * 

* Only use this debugger if really required, Android has a good java.util.logging * implementation, therefore {@link org.jivesoftware.smack.debugger.JulDebugger} is preferred. *

* It is possible to not only print the raw sent and received stanzas but also the interpreted * packets by Smack. By default interpreted packets won't be printed. To enable this feature * just change the printInterpreted static variable to true. * */ public class AndroidDebugger extends AbstractDebugger { /** * Constructs a new Smack debugger for Android. * * @param connection the connection to debug. */ public AndroidDebugger(XMPPConnection connection) { super(connection); } @Override protected void log(String logMessage) { Log.d("SMACK", logMessage); } @Override protected void log(String logMessage, Throwable throwable) { Log.d("SMACK", logMessage, throwable); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy