Do's and Don'ts for Android development

Do‘s and Don‘ts for Android development, by Futurice developers

  1. Use Gradle and its recommended project structure
  2. Put passwords and sensitive data in gradle.properties
  3. Don‘t write your own HTTP client, use Volley or OkHttp libraries
  4. Use the Jackson library to parse JSON data
  5. Avoid Guava and use only a few libraries due to the 65k method limit
  6. Use Fragments to represent a UI screen
  7. Use Activities just to manage Fragments
  8. Layout XMLs are code, organize them well
  9. Use styles to avoid duplicate attributes in layout XMLs
  10. Use multiple style files to avoid a single huge one
  11. Keep your colors.xml short and DRY, just define the palette
  12. Also keep dimens.xml DRY, define generic constants
  13. Do not make a deep hierarchy of ViewGroups
  14. Avoid client-side processing for WebViews, and beware of leaks
  15. Use Robolectric for unit tests, Robotium for connected (UI) tests
  16. Use Genymotion as your emulator
  17. Always use ProGuard or DexGuard

更多请关注原文:https://github.com/benniaobuguai/android-best-practices#use-gradle-and-its-recommended-project-structure

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。