From my search, i got the below code for getting the Crash Log .
try {
Process process = Runtime.getRuntime().exec(\"logcat -d\");
BufferedReader buf
I recommend you use ARCA https://github.com/ACRA/acra.
Include arca in your build.gradle--it uses the apache 2.0 license as of 10/29.
compile 'ch.acra:acra:4.9.0' //TODO: Apache 2.0 license https://github.com/ACRA/acra
In your class that extends Application, drop this on top of the "class" declaration.
@ReportsCrashes(mailTo = "someone@somewhere.com",
customReportContent = { ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT },
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.resToastText) //you get to define resToastText
public class MyApplication extends Application {
Then override the following method from the same Application class like so:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// The following line triggers the initialization of ACRA
ACRA.init(this);
}