tags:

views:

275

answers:

4

Hi

Were now testing our application with a few friends. Sometimes there are some errors which dont throw an exception. So I don't really know whats the problem was. So i thought it would be a good idea to implement a menu item which allows to send the logcat file to a email adress, so that we can examine the logcat.

Unfortunately I didnt found a hint in the Internet how to extract the Logcat from a phone. How to send a email shouldn't be the problem.

+3  A: 

Look at android-log-collector, as it does what you are trying to do.

CommonsWare
hmm thanks. so i have to add the source to my project or to install the app on the phone. right?
Roflcoptr
You'd have to ask them, as I have not used their stuff. At minimum, you could look at their source code to see how they read the logs.
CommonsWare
hmm yes i read on the page that developers can use it, but however there is no documentation and i dont know how to start it. but thanksè
Roflcoptr
+3  A: 

I would also look into Flurry (flurry.com) which not only gives you general analytics but allows you to log arbitrary info and also logs uncaught exceptions for you. I set it up in literally 5 minutes, but one thing to keep in mind is that it's not real-time like an email alert. You'll have to wait a few hours for what you log in your app to show up on their dashboard. It could also be overkill if you have a really lightweight app, but I've noticed no performance loss in my app as a result of using the service.

Brandon
A: 

Thanks to you 2 but by browsing the android-log-collector forum I found a solution that is even easier to handle:

http://trace.nullwire.com/

There you can store a php file somewhere on your server (or if you dont want to use your own server, they also have a script on their servr). In this php file you can define what shall be done when the post message reaches the server. I just definded a very simple code which forwards the data to my mail adress.

This only works if an uncaught exception was thrown. But one could extend the default uncaught exception handler, so that it's also possible to not only get the stacktrace but also the logcat.

Roflcoptr
A: 

I'd definitely recommend to look also at this project here: http://code.google.com/p/acra/wiki/ACRAHowTo

Juri