Android ICS (api 14) introduced the ApplicationErrorReport class with the following info:
CrashInfo BatteryInfo and ANRInfo. From the class overview it seems that this class refers to all application installed on the device and not for debugging your own personal application.
I cannot seem to reach that information (simulated crashes and anr’s)
I tried this code:
ApplicationErrorReport appp = new ApplicationErrorReport();
CrashInfo test = appp.crashInfo;
Log.i(test.stackTrace);
but i get that test is null
How to get the crash information?
In the ApplicationErrorReport API it says:
This means that the “type” of error is undefined, so it’s not a crash report and therefore the crashinfo is null.
EDIT:
I took a look at the source code. You can instantiate the CrashInfo part via the method
readFromParcel(in)where the firstintin the parcel is the int corresponding toApplicationErrorReport.TYPE_CRASH. Alternatively you can create a CrashInfo object yourself and assign it to the ApplicationErrorReport, but this again requires a parcel if you want to CrashInfo data to be filled.I tried looking for code where it is used, but the only thing I could find is the
ApplicationManagerNative(also using parcels).