Tag: Receiver speed also factor listview memory using tag operation
1. Layout optimization
<include> tags are used primarily for layout reuse,<merge> labels and <include> with reduced layout levels, Viewstub provides on-demand functionality, The layout in Viewstub is loaded into memory when needed, providing the program's initialization efficiency.
<include> tag only supports attributes that start with Android:layout
2. Drawing optimization
Drawing optimization refers to the OnDraw method of view to avoid performing a large number of operations, which is mainly reflected in two aspects:
A, do not create a new local object in OnDraw. Because the OnDraw method may be called frequently, it produces a large number of temporary objects in a flash.
B, do not take time-consuming tasks in the OnDraw method. Because this will cause the view to not draw smoothly.
3. Response Speed
Android rules that if the activity fails to respond to screen touch time within 5 seconds or if the keyboard input event occurs, the ANR will appear if the broadcastreceiver is not completed within 10 seconds.
4, the optimization of the ListView
Adopt Viewholder and avoid time-consuming operation in GetView;
Depending on the sliding state of the list, the frequency of task execution is controlled, such as when the list is sliding quickly, it is obviously not suitable to open a large number of asynchronous tasks;
Try turning on hardware acceleration to make the ListView slide smoother.
The optimization of the ListView applies to the GridView.
5. Other optimization
The optimization of bitmap is mainly done by bitmapfactory.options to sample the images as needed.
Android Performance optimization