Contributing to MadBike Android app

Hacktoberfest is a month-long celebration of open source in which people are encouraged to contribute to open source projects in GitHub.

I started this year’s contributions by making a pull request to MadBike an app that helps make use of Madrid’s public bike rental service.

In particular, this contribution tackles a reported issue for adding a map type selector using the Google Maps Android API. The proposed design hinted to that of Google’s default:

Therefore, to achieve the proposed design and functionality I made use of a Spinner which takes as an input an ArrayAdapter with the translated Strings from the application’s resources.

The app makes use of a fragment that implements the onMapReady callback to draw the different UI elements. I simply added a private method that adds the spinner whenever the onMapReady callback is triggered. The last thing I did was adding the spinner to the fragment layout.

The most time consuming piece of work was related to properly setting up the application itself for development since the crashlytics dependency was not correctly configured.
In order to fix that, I had to do quite a bit of research and find the proper crashlytics version compatible with the code which led me to submit another Merge Request that was rejected for the sake of not polluting the maintainer’s production statistics. Furthermore, I had to fight with the Gradle configuration as well until I was able to successfully build the app.

Overall, this contribution helped me refresh my Android development skills and learn about Butter Knife, a framework to inject views into Android components that I had never heard about before. As usual Voguella’s website has a really nice tutorial for it.

The final result is shown below:

The not so happy part of the story is that my contribution has not yet been accepted.
This is one of the drawbacks of contributing to open source projects as understandably maintainers work on them mostly on their spare time with no other reward than their personal interest on the project itself.

This has been the case as well for another contribution that I did some time ago for the Jinja project that is still pending to be merged.

comments powered by Disqus