The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.

Finding CPU Bottlenecks

CPU issues tend to manifest themselves in three ways:

Regardless of how the issue appears to the user, in the end, it is a matter of you using too much CPU time. That could be simply because your application is written to be constantly active (e.g., you have an everlasting service that uses TimerTask to wake up every second and do something). There is little anyone can do to help that short of totally rethinking the app’s architecture (e.g., switch to AlarmManager and allow the user to configure the polling period).

However, in many cases, the problem is that you are using algorithms – yours or ones built into Android — that simply take too long when used improperly. This chapter will help you identify these bottlenecks, so you know what portions of your code need to be optimized in general or apply the techniques described in later chapters of this part of the book.


Understanding this chapter requires that you have read the core chapters and understand how Android apps are set up and operate. Reading the introductory chapter to this trail is also a good idea.

Android Studio’s Profiler

The preview of this section was whisked away by a shark-infested tornado.

Method Tracing

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Other General CPU Measurement Techniques

The preview of this section apparently resembled a Pokémon.

UI “Jank” Measurement

The preview of this section is in an invisible, microscopic font.