Display Logs for the Android Client

You can log the messages sent and received by your Android client, as well as connection information, using the tools built into Android Studio.

Before You Begin

This procedure is part of Checklist: Build Android Clients Using Kaazing Gateway:

  1. Use the Kaazing Gateway Android Client API
  2. Secure Your Java and Android Clients
  3. Display Logs for the Android Client

Note: Learn about supported browsers, operating systems, and platform versions in the Release Notes.

To Enable Android Client Logging

  1. Build your Android client as described in Use the Kaazing Gateway Android Client API.
  2. In the Android Studio project for your Android JMS client, import the java.util.logging classes:
        import java.util.logging.Level;
        import java.util.logging.Logger;
        
  3. Import the Android JMS Client API Tracer utility:
        import com.kaazing.gateway.jms.client.util.Tracer;
        
  4. In the onCreate() method of your Android JMS client, add the following statements.
        Tracer.DEBUG = true;
        Logger logger = Logger.getLogger("com.kaazing.ws.client");
        logger.setLevel(Level.FINE)
        
  5. Save your project.
  6. Follow the steps in the Android Studio documentation to use Logcat:

See Also

You have completed the Android client checklist. For more information about the Kaazing Gateway Android Client API, see Kaazing Gateway Android Client API.