Android Optimization Chapter

Source: Internet
Author: User

http://my.oschina.net/u/586684/blog/207844

1. use a conservative service

2. free memory When the view becomes hidden :

  When a user jumps to a different app and your view is no longer displayed , you should release the resources that the app view occupies. This frees up the resources that can significantly improve the cache processing capacity of the system, and has a direct impact on the user's experience quality.

using the optimized data container:

such as Sparsearray, sparsebooleanarray and longsparsearray. Traditional HashMap The implementation in memory is very inefficient because it needs to establish a mapping relationship in memory for each item in the map. In addition, the Sparsearray class is very efficient because it avoids the need for automatic enclosure (Autobox) key and some values in the system .

use code obfuscation to get rid of unwanted code

The Code obfuscation tool Proguard reduces, optimizes, and confuses your code by removing unused code and renaming classes, fields, and methods through semantic ambiguity. Use it to make your code more concise and a smaller amount of RAM mapped pages.

signing the APK file with the signature tool

If after building the apk you did not do any subsequent processing (including signing according to your certificate), you must run the zipalign tool to re-sign your apk, if not doing so will cause your app to use more memory, Because things like resources are no longer mapped from the APK (mmap).

Note: The Goole Play Store does not accept unsigned apk

Java Performance Tuning

Http://blog.csdn.net/lilu_leo/article/details/8115612#t1%EF%BC%8C%E5%85%B7%E4%BD%93%E5%81%9A%E6%B3%95%E8%AF%B7 %e5%8f%82%e8%80%83%e8%af%a5%e8%bf%9e%e6%8e%a5%ef%bc%89

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.