Image for post
Image for post
Photo by Aleksejs Bergmanis from Pexels

Navigation in developing Android apps is quite important and you should think twice what library suits (or your own solution) most and how it will be convenient to use when the app becomes bigger. Also, it might be good to think about how easy it will be to change your implementation to another one.

Before we will start, let me tell a story. Let's call it like this "How we made project modular and why I hated our navigation".

We had a single module project and everything worked fine except building time, that is because we used Dagger and it took too long to generate a single component. So we decided to separate the project into modules by features, for example, a login feature, a help feature and etc. …

Image for post
Image for post
Photo by Drew Beamer on Unsplash

Have you ever thought how to run UI tests without lots of devices, how to publish the app without visiting the Google Play Console or maybe how to make a “program” that will check your code with lint, then run the unit and the UI tests, and finally, publish the app on Google Play? If so and you did not find a solution, I will show you how it can be done.

As a CI service, we will use CircleCI because they give you 1500 free build minutes per month and also it is possible to build projects that are hosted in the private repositories, but CircleCI only works with GitHub and Bitbucket. For running UI tests we will use Firebase Test Lab because they allow you to run up to 15 instrumentation tests per day. Dropbox to store the signing key and its credentials. …

Image for post
Image for post
"Ottawa road in the evening" by Marc-Olivier Jodoin on Unsplash

Have you ever written something like this to manage the Dagger components?

In my opinion, managing the Dagger components this way forces you to have a huge application class and also you have to write the getSomeComponent, removeSomeComponent code by yourself. Then, in the activity or fragment, you have to get the application, cast it to the YourApplicationClass. Finally, call the needed method to get the component.

Another way is to have an appComponent in the application class and build a feature component right in the activity or fragment. Now you don’t have a huge application class, but still, you have to get the application, cast it, then get the appComponent, and finally, build a feature component (or a subcomponent). But there is a problem: how to save the component during configuration changes? …


Valery Ponomarenko

Senior Android Developer @ SOTI Inc

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store