Features
Freeze detection
A call to LastCrash.applicationInitialized()
must be made after your app is initialized in order to track freeze (application not responding or ANR) errors.
The reason this call to LastCrash.applicationInitialized()
is required is to starting Freeze monitoring only after everything in your app is initialized/loaded so false positives can be avoided.
Masking
All text that isn't part of the app's localization files will be redacted on device to prevent any user or customer PII from being captured. Ensure that all user interface elements are utilizing localization strings to get the most value out of the recorded crash videos.
View based masking
Views can be explicitly masked by passing a View object reference or by view id. An important note: it is your responsibility to manage the masked view lifecycle to add and remove masked views as they are shown on the screen.
A best practice is to add masked views in onResume
methods of an Activity
or Fragment
.
// Mask view by object reference
LastCrash.addMaskView(view)
// Mask view by id
LastCrash.addMaskViewId(R.id.masked_view)
Masked views should be removed in the onPause
method of an Activity
or Fragment
.
// Remove mask view by object reference
LastCrash.removeMaskView(view)
// Remove mask view by id
LastCrash.removeMaskViewId(R.id.masked_view)
Rectangle based masking
Sections of the screen can be masked by rectangles relative to the app's container view frame. An important note: it is your responsibility to manage the masked rect lifecycle to add and remove masked rects.
A best practice is to add masked rects in onResume
methods of an Activity
or Fragment
.
// Mask view by rect
LastCrash.addMaskRect("masked_rect", new Rect(0,0,100,100));
Masked rects should be removed in the onPause
method of an Activity
or Fragment
.
// Remove mask rect
LastCrash.removeMaskRect("masked_rect");
Networking
A LastCrashInterceptor
class must be added to the OkHttpClient before its built to track networking errors and get summarized networking statistics including bytes sent/recieveed and response time.
OkHttpClient.Builder builder = new OkHttpClient.Builder();
builder.addInterceptor(new LastCrashInterceptor());
OkHttpClient client = builder.build();
Force termination detection
Add the following service to your application manifest within the application
tag in order to properly track user force terminations:
<service android:name="io.lastcrash.sdk.ForceTerminationService"/>
Look at the application manifest in this repo for reference.