Guest post: How I give back to open source community by improving Android SDK
Editor’s note: Guest blogger Jason Boehle is Android developer in Coupons, Inc.
He uses open source in his work and occasionally contributes to open source projects.
It’s been more than 5 years since I became the first mobile developer at Coupons.com, after they acquired my app Grocery iQ. Since then, we’ve built a great mobile engineering team and used many open source projects in our apps. Until recently though, we used a homegrown analytics solution, mostly due to data privacy concerns with hosted analytics providers. Around the start of 2014, we discovered Countly. With it being open source and able to be self-hosted, we found a possible successor to our internal analytics tool. Fast forward to the end of March, we made our Android Coupons.com app the first Countly test subject and rolled it out to production. For the initial roll out, we did not use custom events; those were added over the next few months as we integrated Countly into the rest of our mobile apps and expanded to over 50 custom events. We love the slick Countly UI, real-time dashboard, and easy SDK integration.
Open source software often makes our lives as developers much easier. When you consider how much development time can be saved by making use of ready-made open source components, it should be easy to justify spending some time giving back to the community. However, due to the frantic pace at which our industry moves, that is often not the case. My team has spent a lot of time over the past two years optimizing our efficiency, so recently we have been keeping an eye out for an opportunity to give back to the open source community.
Given our newfound reliance on Countly, I decided to take a look at their open source SDKs. I checked out the latest Countly Android SDK from Github and started exploring. After taking the time to understand the code, I saw several opportunities for improvement. Like most code bases, the SDK was in need of comprehensive unit tests, documentation, and more robust error handling.
I spent some time in late June working to improve the Countly Android SDK. First I broke out the classes contained in Countly.java to a single class per source file to make it easier to comprehend and maintain. In parallel to improving the existing code and fixing a few bugs discovered along the way, I wrote unit tests for every class in the SDK. I also added JavaDoc and code comments to help out new SDK users & future open source contributors. After committing all of these improvements to my Github fork, I submitted some tickets to the master Countly Android SDK project to cover the improvements I had made.
Later the Countly team contacted me to go over the tickets I had filed. They were excited to learn about the improvements I had made to the Android SDK. Since so many changes had been made to the code, we agreed that I didn’t need to submit a bunch of pull requests. Instead, they would review and manually incorporate my changes. After merging my work into a new branch with some minor changes, I updated a few unit tests and fixed a bug (that the unit tests caught!), and now the Countly team is preparing to release an official update to the SDK.
The major improvements made in the new Android SDK release are:
- Comprehensive unit tests & documentation
- More robust error handling and parameter checking
- Ability to supply custom device identifier instead of using OpenUDID
- Countly API is now thread safe
I am very excited about the improvements in this release and I can’t wait for it to be available to all Countly Android SDK users.
I hope that my experience encourages others to contribute to open source. The Countly team was easy to work with, accepting of my changes, and appreciative of my work. I’d like to give special thanks to Artem Salpagarov for reviewing and merging my code. I enjoyed working on the SDK and look forward to further collaboration with the Countly team. For those developers out there making use of open source, don’t be afraid to jump in head first and give back to the community!