Crash tracking lets you analyze crashes and exceptions in your mobile application.

Parameters

Parameters are sent automatically to Mapp Intelligence as soon as crash tracking is enabled. However, you need to configure them in your account to properly analyze them in Intelligence.

ParameterDescriptionWhere to configure (Mapp Q3 > Configuration > ...)Where to analyze
Crash - Type

Type of crash:

  • 1: Uncaught
  • 2: Caught
  • 3: Custom
Categories > Custom Parameters > Event Parameter
metric
Crash - NameName of the crash. Name as given by the system or custom name in case custom type is used.Categories > Custom Parameters > Event Parameter

Navigation > Event Parameter > [Name of Parameter]

Crash - MessageCrash message. Message as given by the system or custom message in case custom type is used.
Crash - Cause MessageThe parsed string of the crash messages.
Crash - StackStack where the crash happened.
Crash - Cause StackStack that caused the crash.

Methods

Enable crash tracking in global configuration:

MethodDescriptionTracking OptionsDefault

enableCrashTracking(exceptionLogLevel: ExceptionType)

Enables crash tracking in global configuration. The following types can be tracked:

  • Uncaught exceptions
  • Caught exceptions
  • Caught exceptions with custom messages

The following configuration options are possible:

  • NONE: Crash tracking is disabled.
  • ALL: All crash types can be tracked.
  • UNCAUGHT: Only uncaught exception types are tracked.
  • CAUGHT: Only caught exception types are tracked.
  • CUSTOM: Only custom exception types are tracked.
  • UNCAUGHT_AND_CUSTOM: Tracks uncaught and custom exception types.
  • UNCAUGHT_AND_CAUGHT: Tracks uncaught and caught exception types.
  • CUSTOM_AND_CAUGHT: Tracks custom and caught exception types.

NONE

trackException(
exception: Exception
)

Tracks caught exceptions.--

trackException(
name: String,
message: String
)

Tracks caught exceptions with custom name and message.--

Example

  1. First, enable crash tracking in your global configuration settings:

    val webtrekkConfigurations =
         WebtrekkConfiguration.Builder(listOf( "12345" ), "https://track.mapp.com" )
             .enableCrashTracking(ExceptionType.ALL)
             .build()
    Webtrekk.getInstance().init( this , webtrekkConfigurations)
    JAVA
  2. Then, track the desired exception in your application screens:

    //Uncaught exception
    trackUncaught.setOnClickListener {
         Integer.parseInt( "@!#" )
    }
     
    //Caught exceptions
    trackCaught.setOnClickListener {
         try {
             Integer.parseInt( "@!#" )
         } catch (e: Exception) {
             Webtrekk.getInstance().trackException(e)
         }
    }
     
    //Custom exceptions
    trackCustom.setOnClickListener {
         try {
             Integer.parseInt( "@!#" )
         } catch (e: Exception) {
             Webtrekk.getInstance().trackException( "Hello" , "I am custom exception :)" )
         }
    JAVA



Full Code Example

class CrashActivity : AppCompatActivity() {
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super .onCreate(savedInstanceState)
         setContentView(R.layout.activity_crash)
 
         //Uncaught exception
         trackUncaught.setOnClickListener {
             Integer.parseInt( "@!#" )
         }
 
         //Caught exceptions
         trackCaught.setOnClickListener {
             try {
                 Integer.parseInt( "@!#" )
             } catch (e: Exception) {
                 Webtrekk.getInstance().trackException(e)
             }
         }
 
         //Custom exceptions
         trackCustom.setOnClickListener {
             try {
                 Integer.parseInt( "@!#" )
             } catch (e: Exception) {
                 Webtrekk.getInstance().trackException( "Hello" , "I am custom exception :*" )
             }
         }
     }
}
JAVA
  1. First, enable crash tracking in your global configuration settings:

    List<String> ids = new ArrayList<>();
             ids.add( "1" );
     
    WebtrekkConfiguration webtrekkConfiguration2 = new WebtrekkConfiguration.Builder(ids, "https://www.webtrekk.com" )
             .enableCrashTracking(ExceptionType.ALL)
             .build();
    Webtrekk.getInstance().init( this , webtrekkConfiguration);
    JAVA
  2. Then, track the desired exception in your application screens:

    //Uncaught exception
    Button trackUncaught = findViewById(R.id.trackUncaught);
    trackUncaught.setOnClickListener( new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             Integer.parseInt( "@!#" );
         }
    });
     
    //Caught exceptions
    Button trackCaught = findViewById(R.id.trackCaught);
    trackCaught.setOnClickListener( new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             try {
                 Integer.parseInt( "@!#" );
             } catch (Exception e) {
                 Webtrekk.getInstance().trackException(e);
             }
         }
    });
     
    //Custom exceptions
    Button trackCustom = findViewById(R.id.trackCustom);
    trackCaught.setOnClickListener( new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             try {
                 Integer.parseInt( "@!#" );
             } catch (Exception e) {
                 Webtrekk.getInstance().trackException( "Hello" , "I am custom exception :)" );
             }
         }
    });
    JAVA



Full Code Example

public class CrashActivity extends AppCompatActivity {
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super .onCreate(savedInstanceState);
         setContentView(R.layout.activity_crash);
 
         //Uncaught exception
         Button trackUncaught = findViewById(R.id.trackUncaught);
         trackUncaught.setOnClickListener( new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 Integer.parseInt( "@!#" );
             }
         });
 
         //Caught exceptions
         Button trackCaught = findViewById(R.id.trackCaught);
         trackCaught.setOnClickListener( new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 try {
                     Integer.parseInt( "@!#" );
                 } catch (Exception e) {
                     Webtrekk.getInstance().trackException(e);
                 }
             }
         });
 
         //Custom exceptions
         Button trackCustom = findViewById(R.id.trackCustom);
         trackCaught.setOnClickListener( new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 try {
                     Integer.parseInt( "@!#" );
                 } catch (Exception e) {
                     Webtrekk.getInstance().trackException( "Hello" , "I am custom exception :)" );
                 }
             }
         });
     }
}
JAVA