Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a log trace of the application life cycle
    primarykey
    data
    text
    <p>I have created an application that extensively requires user inputs and interaction and even though I have made sure that I test and catch every possible case that might throw an error I want to be able to create a mechanism that traces the error in case my application crashes on the field.</p> <p>I want to be able to record the entire flow right from a button click till whatever the user might be selecting or the navigation between the pages in a log file such that in case my application crashes I'm able to study the trace file later and know exactly where the error occurred.</p> <p>I'm very new to this sort of programming and therefore any pointers on the above will be very helpful! Thank you in advance :]</p> <p>PS: I'm not even sure whether what im referring to will be correctly called a "log trace" or not so any edit is welcome. :)</p> <p>EDIT : I also want to be able to save the error report generated and send it to a particular id (similar to 'send an error report to xyz).</p> <p>UPDATE :</p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { File myFiles = new File("/sdcard/ScanApp"); if(!myFiles.exists()) { myFiles.mkdirs(); } File myFile = new File("sdcard/ScanApp/log.txt"); myFile.createNewFile(); myFile.delete(); myFile.createNewFile(); String cmd = "logcat -d -v time -f "+myFile.getAbsolutePath()+ " -s ActivityManager:V"; Runtime.getRuntime().exec(cmd); Logs.this.finish(); } catch (Exception e) { flag=1; error=e.getMessage(); } </code></pre> <p>I used this in a previous application for recording any application activity and make a textfile and save it to the SD card, but the contents weren't exactly what I was looking for. Is the solution im looking for something along these lines?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload