How to do Activity profiling in Android
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:
http://developer.android.com/guide/developing/debugging/debugging-tracing.html#format
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
Debug.startMethodTracing("calc");
to start method tracing and add the traces to calc.trace
and I'm stopping the method tracing in my onDestroy().
Debug.stopMethodTracing();
开发者_JAVA技巧
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.
In the manifest I have added the required permission for this.
I think it is just a typo. Use Debug.stopMethodTracing() in onDestroy(). (note that in you post it is Debug.startMethodTracing();) Or may be you activity just don't been destroyed, so yo can try to add Debug.stopMethodTracing() to onPause()
精彩评论