Skip to content

Latest commit

 

History

History

android-crash-user-consent

Kotlin Example for Instana Android Agent

This app showcases the simplest use case of the Instana Android Agent in an Android app written using:

  • Kotlin
  • Coroutines
  • OkHttp3

This app enables crash reporting with user consent dialog. The crash generated in the example app is reported and can be seen in the dashboard .

Before generating crash a dialog box appears for user consent:

Instana Android Agent example

If yes is tapped then the alert box appears as shown below

Instana Android Agent example

Two options are available:

Instana Android Agent example

When generate crash button is clicked the app crashes:

Instana Android Agent example

After the first launch, if the app is launched again and if yes was tapped in the first launch then it will displayed as shown below

Instana Android Agent example

if no was tapped in the first launch then the generate crash button will be disabled as shown below

Screenshot 2023-07-26 at 4 03 09 PM

Compiling

Open ExampleApp.kt and replace these two values with your own (obtained in your Instana Dashboard):

  1. REPORTING_URL
  2. KEY

Compile as usual using Android Studio 3.x

Structure