Android Stack Migration at Boolio


Quick Introduction

Since this is my first post on Medium, I’d like to introduce myself. I am Chris Lee (Olin College ‘15), currently working as a Software Engineer at indico and CTO at Boolio.

Migration

Recently, there was a publication in Medium Engineering about Medium Android Tools :

“We owe a deep debt to the communities that fashioned the tools that made it possible.” — Medium Engineering, Daniel McCarthy

Here at Boolio, we would also like to extend our gratitude. Our most recent Android release involved a migration to several of the tools listed in the post, including Butter-knife, Retrofit, Glide, and Fabric.

These integrations cut our own source by more than 500 lines, which greatly improves the maintainability of our code base — albeit by outsourcing it to the beautiful open-source communities out there.


From Volley to Retrofit

Switching from Volley to Retrofit contributed to trimming down our code base the most. With Volley for every route, we had a ton of code wrapping a request to our servers.

  1. We created a custom request handler to take care of logging, handling errors, and parsing success responses.
  2. For each route we had, we wrote a small wrapper function to take in the request inputs and make the request.
  3. Once the request comes back, custom callbacks with custom parsers parsed the input into objects for the app to use.

With Retrofit, it all went away.

  1. Retrofit (together with okhttp) made making requests as simple as a declaring a routing table with @decorators.
  2. For custom logging and request packaging, Retrofit provided interceptor classes that intercepted incoming and outgoing requests.
  3. Using its own parser around GSON, Retrofit kindly parsed outgoing and incoming data. Additionally, this placed some nice restrictions on the request and response format our server accepted — this really forced us to clean up and standardize our API.

With every step we take, we will continue to improve the service and experience Boolio has to offer. We are always on the lookout for newer and better technologies, so if you have any suggestions, step right up, and stay tuned!

Follow us on Twitter and Facebook.