Do's and Don'ts for Android development
16lz
2021-01-23
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 the65k 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
更多相关文章
- OpenGL ES教程VI之纹理贴图(原文对照)
- NestedScrollView+RecyclerView滑动冲突问题,加载更多
- Android Fresco图片处理库用法API英文原文文档2-1(Facebook开源An
- Activity生命周期的回调,你应该知道得更多!--Android源码剖析(上)
- 原文:Android Theme XML
- Android Fresco图片处理库用法API英文原文文档2-2(Facebook开源An
- Android中文文档v0.1 beta低调发布,期待更多同学来参加review
- Android公共库——图片缓存 网络缓存 下拉及底部更多ListView 公