Hotwire Tech Blog

Scribes from Hotwire Engineering

Overview


Our Android application originally started out using AsyncTask to make our api calls. This tightly coupled the networking calls to our Activity lifecycle. Any configuration change would force the Activity to be restarted, and by extension the AsyncTask would be restarted. At Hotwire we wanted to change how we were making and handling our api calls and decouple this from the Activity lifecycle. During the change to a more robust and thought-out architecture for handling our data we wanted to ensure that we built in client-side caching, made the new framework easily expandable to new requirements, abstract away where the source of data was originating, and…

Read more...

Overview

 

Our Android app had grown at a rapid pace, and more growth was on the way. Our UI widgets were defined in the same classes as our API response handlers. Some of our activities were over two thousand lines of code. Activities and Fragments that had originally seemed short, succinct, and well organized had grown into an unrecognizable thicket of Java. We needed to tame this wild growth before our code base became another spaghetti code behemoth. Enter MVP.

As anyone involved in the Android development community is likely aware, the Model View Presenter (MVP) architecture has gained a lot of traction in the past few years…

Read more...