0

My application uses resources (database, network connection) and tends to have exceptions and errors. On the service side I log the errors, but sometimes I'd really need to know what happened on the phone, what caused the problem.
What is the best practice to log the errors? Should I create a text file on the phone and send it to the server periodically? Is there a better approach?

Nestor
  • 8,194
  • 7
  • 77
  • 156
  • 1
    [refer here](http://stackoverflow.com/a/16562770/2345913) – CRUSADER Jul 05 '13 at 09:41
  • Did you use it? I'm struggling to make it work. – Nestor Jul 05 '13 at 12:30
  • Yes, where are you stuck?? – CRUSADER Jul 05 '13 at 13:00
  • Instead of exiting, I want to show a Toast or a Dialog, but after showing it, my app just hangs, and the OS eventually offers to close it.The inteface provides a _public void uncaughtException(Thread thread, Throwable exception)_ method and I was advised to use the calling thread to show the message. I don't know, how to utilize the incoming Thread object. – Nestor Jul 08 '13 at 08:17
  • The basic target of error logging is to let us(developers), get error logs and know where exactly the issue as occurred.. while the user remains unaware of the major crash as occurred. There is no point in showing dialog or toast to notify the user. Make sure your error gets solved before the end user boils up with issues raised. – CRUSADER Jul 08 '13 at 08:25
  • I don't want to show them the error. I want to show some notification. I don't understand why the app hangs. I used the context to run on the UI thread, but nothing is shown: _((Activity)myContext).runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(myContext, stack, Toast.LENGTH_LONG).show(); } });_ – Nestor Jul 08 '13 at 08:46
  • It would be better if you post this as different question altogether, I am sure there will be many like me, who will be happy to help you.. – CRUSADER Jul 08 '13 at 08:48

1 Answers1

0

Use ACRA, it is recommended by many developers.

Nestor
  • 8,194
  • 7
  • 77
  • 156