title: How to do Activity profiling in Android
body: <p>I have developed one android application and now I'm trying to do the profiling of my android application. So for this I got a good link here:</p>
  <p><a href="http://developer.android.com/guide/developing/debugging/debugging-tracing.html#format" rel="nofollow noreferrer">http://developer.android.com/guide/developing/debugging/debugging-tracing.html#format</a></p>
  <p>Using this info I'm trying to profile my activity using Debug class that is in the oncreate() method of my activity. I'm using</p>
  <pre><code>Debug.startMethodTracing(&quot;calc&quot;);
  </code></pre>
  <p>to start method tracing and add the traces to calc.trace</p>
  <p>and I'm stopping the method tracing in my onDestroy().</p>
  <pre><code>Debug.stopMethodTracing();
  </code></pre>
  <p>My problem is when I check the calc.trace, the file is always of 0 size. No traces have been updated, and I don't know why.</p>
  <p>In the manifest I have added the required permission for this.</p>