My customers are having a problem with my app, and I have been unable to reproduce the problem on my development phone. How to debug this problem? The android Log class is great, but my customers do not know how to use 'adb' or the USB debug cable. Is there some way to redirect Log output to a file on the phone's SD card? Then the customer could easily email the log file to me. Even if this redirection requires programming on my part, I could at least distribute a 'debug' version of the app.
Thanks, Tom
Ask them to install the free app 'Catlog' from the market, which can e-mail you their logcat output. I find 99% of my app users are able to follow simple instructions and get the output one needs!
Try using the Logger class. The procedure is equal to what you would do in a regular Java application:
try {
FileHandler handler = new FileHandler("logfile.log");
Logger logger = Logger.getLogger("com.somename");
logger.addHandler(handler);
} catch (IOException e) {
}
Actual logging to the file could then be done like this:
logger.log(Level.WARNING, "Log message")
Good luck!
There are free and paid services for crash reporting, you might want to check them out..
The only disadvantage is that to send catlog automatically to you, without user interaction, additional permissions for your app is required.
Those are usually READ_LOGS
, INTERNET
, WRITE_EXTERNAL_STORAGE
permissions and depending on type of App that can influence how much your customers trust you. For example if there is no online sync function I would be suprised that myTasksApp requires internet permissions. Anyway.. Here are solutions (list will be updated):
I hope you find this useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With