Question

I created my own class that inherits from UncaughtExceptionHandler.
By using the uncaughtException function, I thought I could create an AsyncTask to send the crash report/stacktrace to my own server. The problem here is ofcourse that the AsyncTask cant work since it needs to be executed from an activity.

My question is, how can I send the report through an background activity/service/task to my own server? I understood that ACRA uses a Thread of somesort, but I heard that doesn't work flawless. Any ideas on how I could do this?

UPDATE: The problem with ACRA I was talking about:
http://zerocredibility.wordpress.com/2013/07/03/the-problem-with-acra/

PS. Although ACRA does what I want, I am trying to figure out how to do it myself.

Was it helpful?

Solution

My Thoughts

I dont know much about ACRA or any related library for this purpose. But if i had to implement this.

  1. At the time of crash happening. From UncaughtExceptionHandler custom implementation. I would save logs to a file instead of sending that right away to server.

  2. Wait for next app start and send it then to server.

Using whatever to you want service, async task , loader. I would have gone for service to do this in background spawning its own thread.

Now logic and algorithm can be applied to send only mined data or mining can be done at server end. Upto the designs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top