Running a trace

When we have added the trace library to our application, it will block on startup until it can connect to the trace receiver of Android Studio. That means you need to remove the trace library when you are done with the profiler, since it will lead to a useless render.

In order to start a trace, just run and deploy your application. A blank screen will first be prompted while it is waiting for the trace receiver to connect. To enable it, go to the CPU/GPU tab of the DDMS, and click on the red trace button, which you can find on the left side of the GPU tab (Running a trace).

When the tracing starts, the application unlocks and we can interact with ...

Get Android High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.