Some tips on Android code

Source: Internet
Author: User
1) View state save and restore
Dispatchrestoreinstancestate
Onrestoreinstancestate
Onsaveinstancestate

2) service use of front desk services
Startforeground (notification_id, mnotification)
Stopforeground (True)

3) Avoid internal getters/setters avoid internal Get/set accessors
Direct access to member variables is 3 times times faster than using the Get method when JIT is not used. When using JIT, direct access to member variables is as efficient and inexpensive as using local variables, and its access speed can be increased by 7 times times. using Proguard to configure an inline accessor can achieve both effects, both good code structure and fast access speed. (I have not played this inline accessor)

Some tips on Android code

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.