Splunk MINT SDK for Android

Splunk MINT SDK for Android Developer Guide

Download manual as PDF

Download topic as PDF

Verify the SDK is integrated

To verify that the Splunk MINT SDK is correctly integrated into your Android project, look at the Insights page of your Splunk MINT Management Console dashboard to view app activity. You can also crash your app intentionally to review the error information.

  1. Use the following code to intentionally crash your app by causing a nullPointer exception:
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        // TODO: Update with your API key
        Mint.initAndStartSession(this.getApplication(), "YOUR_API_KEY");
    
        // TODO: Update with your HEC token
        // Mint.initAndStartSessionHEC(this.getApplication(), "MINT_HEC_URL", "YOUR_HEC_TOKEN");
    
        setContentView(R.layout.main);
    
        String a = null;
        a.toString();
    }
    Allow some time (usually less than five minutes) for the error instance to appear on your dashboard. If your Splunk MINT Management Console dashboard indicates that your app has crashed, you know your app has successfully integrated Splunk MINT. Further, Splunk MINT generates an email message to inform you about exactly what went wrong.
  2. Crash your app again to see the error counter on your dashboard increase.
  3. To see Splunk MINT logs in your logcat console, enable debug mode by adding the following line before the initAndStartSession or initAndStartSessionHEC method:
    Mint.enableDebugLog();
    
  4. To investigate the cause of the error, go to the Errors page on your Splunk MINT Management Console dashboard. Click the error to examine the information Splunk MINT collects, and examine the error's stack trace to identify the exact lines of code that caused the problem.
PREVIOUS
Add Splunk MINT to your Android project
  NEXT
Use ProGuard with Splunk MINT

This documentation applies to the following versions of Splunk MINT SDK for Android: 5.2.x


Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters