Hi, I am busy writing an app and I have noticed that it sometimes crashes, and when it does and I get back to my computer then I only have the stack trace.
Is there a way for me to take a memory dump of the app at crash time?
Thanks
Hi, I am busy writing an app and I have noticed that it sometimes crashes, and when it does and I get back to my computer then I only have the stack trace.
Is there a way for me to take a memory dump of the app at crash time?
Thanks
Not a memory dump but ACRA, http://code.google.com/p/acra/, (Application Crash Report for Android) is pretty good at recording info about what's going on. With the most detailed info being a stack trace.
The debugging info on it's own might not be super helpful, but you could modify their code to do and send a logcat when your application crashes so you would get some more details about what's going on. I think they don't do this by default for privacy/security reasons but it's a bit more useful to see the logcat around the crash.
Other than that you'd need to debug it with the debugger.
Is there a way for me to take a memory dump of the app at crash time?
Not that I am aware of -- sorry!
If you call android.os.Debug.dumpHprofData(String fileName), you can capture an HPROF dump that can be viewed with jhat or MAT. You'll need to trap the exception somehow (either try/catch or specify your own global default exception handler), and if you want to write to /sdcard you'll need the WRITE_EXTERNAL_STORAGE permission.
See also Dalvik Heap Profiling.