Do's and Don'ts for Android development
Do‘s and Don‘ts for Android development, by Futurice developers
- Use Gradle and its recommended project structure
- Put passwords and sensitive data in gradle.properties
- Don‘t write your own HTTP client, use Volley or OkHttp libraries
- Use the Jackson library to parse JSON data
- Avoid Guava and use only a few libraries due to the 65k method limit
- Use Fragments to represent a UI screen
- Use Activities just to manage Fragments
- Layout XMLs are code, organize them well
- Use styles to avoid duplicate attributes in layout XMLs
- Use multiple style files to avoid a single huge one
- Keep your colors.xml short and DRY, just define the palette
- Also keep dimens.xml DRY, define generic constants
- Do not make a deep hierarchy of ViewGroups
- Avoid client-side processing for WebViews, and beware of leaks
- Use Robolectric for unit tests, Robotium for connected (UI) tests
- Use Genymotion as your emulator
- Always use ProGuard or DexGuard
更多请关注原文:https://github.com/benniaobuguai/android-best-practices#use-gradle-and-its-recommended-project-structure
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。