Recommendations for Android Best practices (translated from android-best-practices)

Source: Internet
Author: User

Best practices on Android Developmentuse Gradle and its recommended project structure use Gradle and its recommended engineering structure put passwords and SE Nsitive data in gradle.properties places the password and sensitive data in gradle.properties. Don ' t write your own HTTP client, use volley or OkHttp libra Ries do not write their own HTTP client docking, using the open source framework volley and okhttp (translator: Actually there are several other also good, REQUEST,LOOPJ) use the Jackson library to parse JSON Data uses Jaskson to parse JSON data (translator: Fastjson's Android version is also good) Avoid guava and use only a few libraries due to the 65k Method Limit Because of the Limited number of Android 65k methods, Avoid using guava open source packages and use only a small number of open source packages (translator: Because Android supports 65,536 methods, so pay special attention)Use fragments to represent a UI screen uses fragment to present the interface using activities just to manage fragments using activity to manage fragmentlayout XM Ls is code, organize them well layout XML is also a program, to manage the use of styles to avoid duplicate attributes in layout xmls using styles to avoid duplicate configuration parameters in the layout xml Use multiple style files to avoid a single huge one uses multiple style configurations to avoid centralizing to a huge style profile keep your colors.xml short and DRY, just define The palette keeps color.xml short, only a few colors of the palette can be also keep dimens.xml DRY, define generic constants also keep dimens.xml short, configure only common constants do Not makes a deep hierarchy of viewgroups do not let the layout hierarchy be deeply avoid client-side processing for webviews, and beware of leaks avoid processing multiple w on the client Ebview, pay particular attention to object overflow using Robolectric for unit tests, Robotium for connected (UI) tests unit test with Robolectric, Robotium for UI connection test use Genymotion as your emulator use Genymotion as simulator always use Proguard or dexguard stick to Proguard and dexguard to protect code

Recommendations for Android Best practices (translated from android-best-practices)

Related Article

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.