Having used MVP in my Android projects for a short while now, I’ve been wondering about reusing Presenter classes when creating applications for more than just Mobile devices. For this reason, I built Bourbon as an experiment to see the kind of code that I could share between different application modules. I’m happy to say that the result turned out to be pretty positive as I was able to share a huge chunk of the applications logic between the Mobile, Wear and TV modules. Without going too in-depth, I decided to put together this article in-order to share my experiment with others.
The article is split into two sections. In the first, we’ll take a quick look at the Bourbon app and what it does – this allows you to see the visuals of the app first. Then in the second part, we’ll take a look at how the code is shared between the different app instances and how the common code module is structured.
What is Bourbon?
Bourbon is (probably yet another) Dribbble client that supports Android wear, TV and mobile (it’s also optimised for tablets!). If you don’t know dribbble already, it’s a community led design platform that allows designers to share their latest creations in the form of ‘shots’. The purpose of Bourbon is to display the latest 20 shots to the user, allowing them to browse for something inspiring from their chosen Android device.