Best Practices for building Android SDKs

Abhishek Nandi
Oct 24, 2016 · 7 min read

To hone a new skill, you need to practice and its not just the quality but also the quantity. Scientists also believe that expert-level performance is primarily the result of expert-level practice and NOT due to innate talent. This is called deliberate practice. While this can be applied to a sport like golf it also applies to software engineering.

In a previous post I talked about How to write SDKs. It was a generic article. This article is very specific to Android and states, what are some of the best practices for writing and publishing performant and good android SDKs/libraries.

The order of the topics have nothing to do with priority or importance.

1. Say No to AsyncTasks

2. Using Android Support Annotations

3. Keeping a low method count

4. Manifest Merger and Groovy variables

5. Check your threads

6. Leverage Platform components

7. Optimize network calls

8. Optional needs

9. Check for permissions rather than taking them

10. Use JCenter or MavenCentral for distribution

11. API Naming Conventions

If you have a similar behavior which exists in the android framework, it would be wise to use similar naming conventions and design patterns so that the library usage feels an extension of the framework. Be advised, I am not encouraging you to use android as part of your package name. While I can go on writing about APIs you can read up on how to design APIs which id documented well in Anup Cowkur’s article.

12. Go for minimum integration effort

13. Minimum permissions

14. Effective Obfuscation

15. Testing the Integration

16. Versioning and release notes

17. Account for changes/updates in your own dependencies

18. Exception handling

19. Follow platform and developer guidelines

While I can go on writing on this, and probably have a few more points to mention here, but I’ll keep this post limited or I’ll never end up publishing it. I started this post 3 months back, I was not getting enough time to complete it. I just thought of hitting publish or else it would never end.

Originally published at

Insights & Metrics

Thoughts on Analytics & Insights for growing your startup…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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