I. Use logcat output with caution
If your application always outputs logs in the background. I or log. d content, in addition to increasing system overhead, affects the overall efficiency of your application, especially the continuous output of a lot of content. Because logs require underlying JNI calls, the overhead of Java virtual machines is not small.
Ii. proguard disturbance
For Android app encryption, the disturbing rule may not only modify the name of classes and variables, but also addAlgorithmThe complexity may change from 1 + 1 = 2 to 2*10-10-8. Of course, Android provides an example to illustrate the working principle of the disturbance.ProgramThe running efficiency and some logic may change, so we need to weigh whether the configuration disturbing rule only modifies the variable name.
3. Basic Knowledge
1. Access variables are faster than accessing fields of A Class/
2. When determining whether the array is null, The getcount () = 0 method is generally not used. It can be processed directly using the isempty () method.
3. Use global static classes with caution in many cases.
4. Many of the CPU usage of the Android Application is put on the JVM resources. Therefore, it is helpful to reduce the memory release or increase the mobile phone Ram to execute the program as much as possible.
5. Register as few System broadcast notifications as possible. At the same time, you can rewrite onpause or onresume to control the display of activity to obtain some system broadcasts.