Advanced Android Programming

Modular Android apps

Erasmus 1 15th August 2016 12:20 pm - 1:05 pm

Bookmark and Share

Ronaldo Pace

To promote a more flexible feature development on EyeEm’s Android platform, Ronaldo and his team developed the decorator and router libraries. To better serve a 17-million strong photo community, they opted for a new architectural pattern that follows the single responsibility principle, favors composition over inheritance, and helps developers iterate much faster on UIs. This allows for dynamic addition of features on demand – feature flags, A/B tests, personalization – and helps avoid “inheritance hell.”

The goal is to decouple responsibilities from the parent class into reusable components. Individual decorators can then be attached to otherwise empty parent classes to do a single job. This allows a simple java class to have multiple and dynamic inheritance. At EyeEm they have engineered an easy-to-use code-generation library to make this pattern scalable with minimal boilerplate, and to automate most of its creation.
The router library was inspired by Clay Allsopp’s Router project and introduces an expansive configuration file that allows newbies, non-technical people and veterans to quickly grasp the relationships between different parts of the app, while simplifying complex URL handling. The configuration can be modified at runtime, opening up the possibilities and flexibility to sideload it from the assets folder, or even change it directly from servers.
In this session you will dive into the technical implementation of a modular application and the talk is accompanied with open sourcing libraries and sample code/implementations. After the session, attendees can implement this pattern into their projects.