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.
- Use the following code to intentionally crash your app by causing a nullPointer exception:
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.
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(); }
- Crash your app again to see the error counter on your dashboard increase.
- 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();
- 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.
Add Splunk MINT to your Android project | Use ProGuard with Splunk MINT |
This documentation applies to the following versions of Splunk MINT™ SDK for Android (Legacy): 5.2.x
Feedback submitted, thanks!