Crash Tracking
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.
Parameter | Description | Where to configure (Mapp Q3 > Configuration > ...) | Where to analyze |
---|---|---|---|
Crash - Type | Type of crash:
| Categories > Custom Parameters > Event Parameter | metric |
Crash - Name | Name 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 - Message | Crash message. Message as given by the system or custom message in case custom type is used. | ||
Crash - Cause Message | The parsed string of the crash messages. | ||
Crash - Stack | Stack where the crash happened. | ||
Crash - Cause Stack | Stack that caused the crash. |
Methods
Enable crash tracking in global configuration:
Method | Description | Tracking Options | Default |
---|---|---|---|
enableCrashTracking(exceptionLogLevel: ExceptionType) | Enables crash tracking in global configuration. The following types can be tracked:
| The following configuration options are possible:
| NONE |
trackException( | Tracks caught exceptions. | - | - |
trackException( | Tracks caught exceptions with custom name and message. | - | - |
Example
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)
JAVAThen, 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 :*" )
}
}
}
}
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);
JAVAThen, 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 :)" );
}
}
});
}
}