Android Question How to read past logs of errors that occured in release mode?

creeper82

Member
Hi, my app has been working for over a year without any problem everyday, but out of nowhere it crashed just one time while doing a routine thing (json related). And that was the only time it crashed - after it restarted it works flawlessly.
The crash happened yesterday - is there any way to read the error message? Is it even possible if it happened 2-3 app uses ago? Is it possible that I accidentally clear the past logs if I do it wrong way?

Also, I've searched the forum but kind of couldn't find an answer that helps me. Any help is appreciated! :)
At the moment I have access to the source code, I'm able to connect with USB debugging and I'm able to use B4a bridge, if any of these helps

BTW is there any way to show exceptions directly on the screen, messagebox or anything? (private app so it doesnt bother me)
I could add a big Try-catch for the entire source code, but wouldn't it override the existing try-catch blocks inside that serve a functionality?
 
Solution
You can catch any uncaught exceptions that would crash the app using Application_Error in Starter. You could write the error to a file and I think maybe a Msgbox will work in Starter but I'm not sure - try it. An outer Try-Catch does not override any inner ones.

agraham

Expert
Licensed User
Longtime User
You can catch any uncaught exceptions that would crash the app using Application_Error in Starter. You could write the error to a file and I think maybe a Msgbox will work in Starter but I'm not sure - try it. An outer Try-Catch does not override any inner ones.
 
Upvote 2
Solution

creeper82

Member
You can catch any uncaught exceptions that would crash the app using Application_Error in Starter.
Thanks for the help. Judging by the examples found on forums - I just need to add Sub Application_error in Starter, where the Error argument contains the string message of the error, and Stacktrace locates it in code? Do I have to return true at end?
 
Upvote 0
Top