Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : Application with Crash dump report

I want to develop a log frame work for my application .The things i want to achieve is

  1. Trace the log of my application
  2. Write the log to a text file while tracing the log
  3. Filter the log genrated by my application
  4. Stop the log trace if any error/exception happens after writing the exception to text file

First of all i want to know is this possible ?? I guess by using service we acheive this . if i am wrong please correct me

I refer this project for achieving my needs https://github.com/androidnerds/logger

In this project they are using AIDL to create a service to record the logs .But the saving of file occur only when ever the intent for that .

Seriously i'm new to this AIDL process . The point that confuses me is the sample project doesn't give any permission in manifest to WRITE FILES to storage .But it's able to do that . How did they achieve that??

Even i had gone through these questions

  1. How do I get the logfile from an Android device?
  2. Programmatically get log cat data
  3. Write android logcat data to a file
  4. Save Data of LogCat in android
  5. How to save LogCat contents to file?
  6. How to write entire Logcat in to sdcard?
  7. Filter LogCat to get only the messages from My Application in Android?

But nothing working for me. So please suggest a way to achieve this

like image 755
edwin Avatar asked Jun 27 '13 11:06

edwin


1 Answers

I suggest to take a look at ACRA.

https://github.com/ACRA/acra

At least if you don't want to use it, it's still open source so you can take a look at the code. They do a lot of thing you want to achieve and when looking at the code you may find answers to your question.

I forked ACRA to make some of the things you mention in your questions :

How do I get the logfile from an Android device?

You can log into the acra report file everything you want. We use a special logger that write into the acra logfile. So we know what is the sequence of events that triggered the crash.

Programmatically get log cat data

It's a text file, we use [sections] and timestamp/key=value to display logs to the users before sending the report. Be careful to anonymize your log reports and do not put personnal informations about your users.

Write android logcat data to a file

Save Data of LogCat in android

How to save LogCat contents to file?

How to write entire Logcat in to sdcard?

Filter LogCat to get only the messages from My Application in Android?

Everything that you ask here is already managed by ACRA. There is an extension mechanism that allows you to write your own sender and your own reporter.

like image 130
Gomoku7 Avatar answered Oct 23 '22 09:10

Gomoku7