Imge is an Android application I developed for a group of physiologists in Istanbul. Please check Part I for details and screens shots.
This part is about the technologies used in Imge.
It’s a (almost!) 100% Kotlin app. This is my third app with Kotlin, after Owly and another one developed for a client. Needless to say, Kotlin is just great – deserves a dedicated article about why to choose it over Java.
Apart from 3 Java files, it’s all Kotlin!
Architecture - MVP
For several years, like many other Android developers, I prefered MVC as my primary architecture choice. However in last couple of years, again like many others, I moved to MVP which is proved to be very solid approach for Android app development.
My implementation for Imge app was very standard and straight-forward: Activities and Fragments as Views, Presenters for each, Model layer for entities and repositories to access Firebase API and other resources:
Model: Room as ORM
Room is a part of Android Architecture Components.It’s the object-relations-mapping library that makes it easy (and even fun) to work with Sqlite. I like Room as it makes my job much easier and the app more stable.
In the model layer I also have my entities, data-access-objects and repository classes for Database operations.
Views and Presenters
Well there is nothing interesting here. It’s the classic Views of MVP (activities and fragments in our case) and presenter for each with the callback interfaces.
In App Billing
Users in the app uses credits to submit tests for a review. Credits are purchasable from the Google Play within the app. Imge uses Google’s In-App-Billing framework to offer these credits as products.
Firebase as Backend service
App uses several Firebase features as a backend service. As I mentioned it many times before, I love Firebase! Without a so complete mobile backend system like Firebase, all projects would take at least 3x more since we would need to develop our own backend API.
Imge uses Firebase Database, Crashlytics, Analytics, Cloud messaging, Remote config, Firebase Storage and Authentication. Anything left? Ah Machine Learning service! We don’t use it (yet)!
DI - Dagger
Actually I’m not a big fan of Dagger but in this project I used Dagger heavily! It really helped me to save time and keep my files clean. There are so many objects that I reuse through the app so Dagger made sense for me. I used both field and constructor injection.
RxJava for Android
I cannot image a data centric app without RxJava now. It makes developer’s life so easy that I admire RxAndroid every single time!
I won’t go into the details of RxAndroid as there thousands of articles online. All I’ll say it RxAndroid did good job in my Repository classes. All data is loaded async and send back to the subscribers. That greatly helps to have a smooth user experience as at no time user is blocked with a heavy work on main thread.
Facebook and Google Sign-In
Lifesaver, simple. I cannot imagine any app user at the moment filling up a long (or even short) registration form with email address and password. I don’t, at least.
The procedure is very standard for Facebook and Google Sign In so we you need to authenticate your users, you should definitely use these.
Stetho for inspecting the app (by Facebook)
I need to admit that I’m not a big fan of Facebook. No, it isn’t about failing an interview with them 🙂
However, stetho by Facebook is a true hero. It always saves me tons of time when it comes to debugging SQLite, SharedPreferences and UI problems.
If you haven’t tried it before, make sure you give it a go.
Stetho – massive help when it comes to hunting bugs around SQLite and SharedPref.
Other 3rd parties
It worth mentioning that I used several other libraries, most of which are quite standard for many developers:
Let me know what you think!
Well these are the techs I used in Imge. I know I haven’t provided much insight about the details of usage of these libraries and services but still I would like to get some feedback!
What do you think? Are there better alternatives? What do you guys use in your projects? What are your must-have libs?
Thanks for reading!