This library allows you to get all the error from your android app to pindMeLive application.
Add the following dependency to your build.gradle:
dependencies {
implementation 'com.github.pingmelive:pingMeLive:1.0.2'
}
Add a snippet like this to your Application
class:
@Override
public void onCreate() {
super.onCreate();
//By default you will get all the crashes and runtime error in a form of error event.
//You will get an API KEY when you will register on pingmelive.com
String appName = "MyGreatApp";
pingMeLive.install(getApplicationContext(),"Error for "+appName,"API_KEY");
//thats it
}
...and you are done!
Of course, you can combine this library with any other crash handler such as Crashlytics, ACRA or Firebase, just set them up as you would normally.
Force an app crash by throwing an uncaught exception, using something like this in your code:
throw new RuntimeException("A dummy error!! No more force stop dialogs!");
You can also use pingmelive for sending custom events.
String userID = "userabc";
Button registerUser = findViewById(R.id.registerUser);
registerUser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Pass group title and your custom event message you want to send.
pingMeLive.simpleEvent("Registeration","Hey we got a new user "+userID);
}
});
If you want to send data with message you can use Detailed event
String userID = "userabc";
Button registerUser = findViewById(R.id.registerUser);
registerUser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Pass group title and your custom event message you want to send and detailed text
pingMeLive.detailedEvent("Registeration","Hey we got a new user "+userID,"You can send the user detail here.");
}
});
No need to add special rules, the library should work even with obfuscation.
This library relies on the Thread.setDefaultUncaughtExceptionHandler
method.
When an exception is caught by the library's UncaughtExceptionHandler
it does the following:
- Captures the stack trace that caused the crash
- Launches a new intent to the error activity in a new process passing the crash info as an extra.
- Kills the current process.
- This will not avoid ANRs from happening.
- This will not catch native errors.
- There is no guarantee that this will work on every device.
- This library will not make you toast for breakfast :)