A trace trick

Posted: August 16, 2009 in Android, Java, Mobile
Tags: ,

This is form one he many hard-working Google Android engineers. a trace file is only so big, about 5 megabytes. Thus, while it might be big enough to record traces in one method its nto big enough to contain all traces of a program. So we set a variable to use in the file-name and incremented it:

 // start tracing to "/sdcard/calc.trace"
   Int b = a+1;
   String aString = Integer.toString(b);
    Debug.startMethodTracing(aString);
    // ...
    // stop tracing
    Debug.stopMethodTracing();

Very simple and effective. If you want to get fancy y0u can prefix a prefix like the word trace.

Reblog this post [with Zemanta]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s