Intro To Android (Workbook 2)

View Inflation

It takes time to draw your views. Whenever possible, reduce deeply nested layouts, reduce work that is required on the main thread, and avoid drawing over the same section of the screen more than once (known as overdraw).

Optimization

Android has articles about including/merging layouts, lazy view initialization, and making scrolling smooth.

Check out Android's guides on optimizing UIs. There's also videos on optimizing layouts with HierarchyViewer and detecting overdraw with HierarchyViewer.

HierarchyViewer

Tracing

You can use tracing tools to find delays in display execution as well as find long running processes. Check out the systrace to get you started with this tool. SysTrace and this

Overdraw

You can find overdraw issues in your application using developer settings on the phone.

Overdraw

It will show overlaid colors to show what parts of your application are being drawn on more than once. Red and dark red are the worst, followed by blue, green (goal), and transparent (your goal).

Overdraw