码迷,mamicode.com
首页 > 移动开发 > 详细

Do's and Don'ts for Android development

时间:2015-01-22 14:37:05      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:

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

Do's and Don'ts for Android development

标签:

原文地址:http://www.cnblogs.com/justin-wang/p/4241289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!