I have implemented the try catch on the exception possible places. There are different other exception will be thrown by android OS[Database Exception, Permission and other exception]. I want to write those error log data into file{only there is a crash on our application}.
Already I have code to write the given data into file. I just want to know how to get the error log from android process.
If there is any crash the app instance is not available. And I don't know the exact place where to call the get the error log method. on this. Please help me on this.
In your application class you can initialize for an unhandled exception. The callback method will have an throwable object. From this object we can get the crash log data and then the same data to be written to the file.
Application Class:
Declare your application class in your manifest in the following tag: