...
// When using try-catch
try {
...
}
catch(e){
throw new Error("Custom error messages");
}
// When to generate default errors
new Error("Custom error messages");
throw new Error("Custom error messages");
public void onClickSomething() {
EventPathManager.CreateEventPath(STEP, LABEL);
}
IdentifierCollector.setUserId("10"); // Register a user ID.
IdentifierCollector.setUserName("My User Name"); // Register a user name.
IdentifierCollector.setUserMail("My User Email"); // Register a user email.
CustomLogCollector.log("test log"); // Leaves the log as a plain string.
CustomKeyCollector.log("My Key", "My Log"); // Leaves the log in the form of key:value.
MyApplication.java
@Override
public void onCreate() {
super.onCreate();
io.imqa.core.IMQAOption imqaOption = new io.imqa.core.IMQAOption();
/*
* Default value: true
* Sets whether to collect ANR information.
* true: Monitors the ANR occurrence status.
* false: Stops monitoring ANR occurrence.
*/
imqaOption.setAnrOn(false);
/*
* Default value : 5000
* anrTimeoutInveral : Sets the time when ANR timeout occurs (in milliseconds.)
*/
imqaOption.setAnrTimeoutInterval(5000);
/*
* Default value : false
* Sets whether to output the log.
* true: Outputs the IMQA Crash log.
*/
imqaOption.setPrintCrashLog(true);
/*
* Default value : true
* Uploads collected crash information as soon as the crash occurs.
* true: Uploads as soon as the crash occurs.
* false: Uploads when executing again after saving.
*/
imqaOption.setCrashDirectUploadFlag(false);
/*
* Default value : false
* Set the compression algorithm.
* true : Using Zstandard (Zstd).
* false : Using gzip algorithm
*/
imqaOption.setCompressZstd(true);
/*
* Default value : 'https://collector.imqa.io'
* Sets the crash server URL.
* String: Server information
*/
imqaOption.setCrashServerUrl('https://collector.imqa.io');
io.imqa.crash.IMQACrashAgent.InitializeAndStartSession(
this, // Application Context
BuildConfig.FLAVOR, // Project Flavor Setting
"PROJECT_KEY", // Issued project key
imqaOption // Add an object when the option is set.
);
}