Android Development: some of the best practices. Jun 2016 edition.

So yeah I feel like something is missed from article up there. Let’s find out what.

  1. Use Kotlin, yeah it’s time! Consider it long term investment in your project and skills.
  2. Think twice before adding any third party library; it’s a serious commitment.
  3. Use only small, one-feature libraries and abstraction layer above it — would be easier to replace in future.
  4. Use dependency injection, it will help you to write more flexible code and tests. Dagger/Dagger2/Kodein is the best choice so far. Thanks Wahib👍
  5. Use Picasso or Glide for async images loading and management.
  6. Use DB for persistent data.
  7. Use OM/ORM for DB objects; save your time.
  8. Do not even think about Realm unless you are sure about what you are doing and how it works. Prefer to use SQLite instead.
  9. Try hard to prevent hitting the 65k limit, with the release of Support Library 24+ it would be much easier.
  10. Use RxJava for async tasks.
  11. Use JobScheduler for long, periodic or state-dependent tasks.
  12. Keep each async task as a separate class.
  13. Do not use RetroLambda.
  14. Do not use EventBus; you already have RxJava and LocalBroadcastManager.
  15. Do not use Guava.
  16. Use ConstraintsLayout to flatten your view hierarchy.
  17. Use DataBindings to write less UI code.
  18. Use AutoValue with Parcel.
  19. Be careful with memory leaks.
  20. Use the AccountManager to suggest login usernames and email addresses.
  21. Keep your colors.xml short and DRY, just define the palette.
    Also, keep dimens.xml DRY, use universal constants.
  22. Test your app in “Don’t keep activities” mode.
  23. Test your app with unlocked screen orientation.
  24. Use Stetho for debug builds.
  25. Use Gradle build tool.
  26. Keep minSdkVersion=21 for development builds; it will speed up compile time, especially if you are using multidexing.
  27. Setup static code analysis tools for your CI builds.
  28. Break your app into small, flexible modules. Assemble this modules and publish it into your private or public maven repo. Add it as a library to your main project.
  29. Filter your logs.

Did I miss something?

P.S. Thanks for your comments, guys!

If you enjoyed this post, please hit the recommend button below and share this. Thank’s!



Staff Software Engineer @LyftLevel5 |

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store