Use open source to avoid reinventing the wheel

Before starting development of Red e App, I had no doubt we would be making heavy use of several open source libraries. That’s a given for any project I’m working on. The SDK’s for iOS and Android are robust, but don’t cover all of the needs of a non-trivial app. The obvious advantage of open source is it helps Red e App to avoid reinventing every wheel. Development can focus on what is unique to Red e App.

For each mobile platform that Red e App runs on (currently iOS and Android), the very first coding task was to set up the development environment to quickly download and reference open source libraries. For Android, the obvious choice was Maven. Whenever faced with a development task where a known open source library is a clear solution, a dependency for the library is added to Maven’s configuration. Maven quickly downloads that library and all of its dependencies. Some of Red e App’s open source dependencies on Android include RoboGuice, Robolectric, and ACRA.

On iOS, the dependency management solution is a tool called CocoaPods. Many iOS and Mac developers don’t know about this tool yet, so they will manually download the code for each library, and do the same for the whole tree of dependencies. In that manner, finally getting the app project to correctly compile and link to the dependencies is a tedious and often very frustrating experience. CocoaPods does that work for you.

For instance, Red e App needed pull-to-refresh behavior in the contacts and messages lists. I simply edit the Podfile and add a line that says: dependency ‘EGOTableViewPullRefresh’. I run “pod install” in my terminal, and CocoaPods downloads the latest code from Github. Xcode is now ready to compile and link to EGOTableViewPullRefresh. This is a nice time and headache saver.

I’ve run into some developers that still balk at the idea of depending on open source for app development. They’ll say something like “Then my app will have to be open source.” or “What if the code has a bug?” Check the license in the open source code. Most of the time, it’s liberal enough to allow commercial use.

As far as bugs in the source code, the open source projects typically have so many users and contributors that I feel very confident most bugs have been addressed. And if not, simply contact the project’s maintainer, report the bug, and often you’ll have a fix within hours. The “what if it has bugs?” excuse is a poor one for most popular open source, especially when the iOS and Android platforms themselves already depend on open source.

But even with the ocean of open source resources provided by GitHub, not every niche is filled. That’s when it’s time to step up and publish your own code. “Scratch the itch” as developers say.

Stay tuned for an example of an open source library I wrote while developing Red e App that will save developers from writing a lot of the boring code needed to consume a web API.

Jamie Willis
Red e App iOS and Android App Developer

Try the employee communication and engagement platform your employees will love and use everyday.

Companies using Red e App create meaningful connection with their entire workforce, increasing efficiency, boosting productivity, improving employee retention, and driving profitability. Start a Free trial to see what it can do for you.

phone high five
Share This Post

More To Explore