Navigation between modules

In the first part of this post, we talked about the testing plans, modularization structure and release plans.

In this post, we will share how we solved the navigation problems and reducing the inter-module dependency for navigation.

Navigating between modules

If all our activities are part of a single app module, starting a new activity is as simple as

startActivity(this, A::class)

Although we do end up increasing the coupling by referring to the class A and this happens across our projects.

For starting a new screen from a different module we had 2 approaches,


Reducing build times by 60%

A very late post about modularization indeed, and hopefully it will help someone on their way on modularization of monoliths and help them reduce their build times.

The context

2 years back, We started unifying our multiple partner apps into one single app using the best available software engineering principles we had learnt.
Practo Pro would be our one single app for all our partner use cases. The features focused on presence management on Practo, practice management, online consultations, leads dashboard for our partners.

We organised our codebase features in packages in one single monolith app module. And with time as we…


TLDR; We created an easy to use wrapper on top of exoplayer api and made it lifecycle aware. Find the source code here

For a recent feature, we needed to add audio streaming support to our application.

Media playback isn’t the most complex topic out there and one can easily start with Mediaplayer APIs.

And well for local media files it works really well, except for a few device-specific issues, or when we have to work on managing states (A little complex), also most of the MediaPlayer updates are tied to the OS update.

The alternative to MediaPlayer is Exoplayer


In the first part of the series, we talked about the dagger annotations and how they are useful in our projects.

In the second part we will look at how we can use Dagger 2 to provide dependencies in our mobile apps.

Add following lines to app build.gradle file



Dependency injection means giving an object its instance variables — James Shore

To sum up what it is

If you want to read more about DI, Follow the link

Dagger 2: Is the library which helps us in managing and providing dependencies for our app in a very efficient way. It builds an object graph of dependencies and creates/provides dependencies wherever they are required in the Object graph.

Setup

We will use IntelliJ CE with…


So if your vector drawable has a lot of decimal point instructions without the leading 0. You will get a lint error as

This check ensures that vector paths are valid. For example, it makes sure that the numbers are not using scientific notation (such as 1.0e3) which can lead to runtime crashes on older devices.

I wrote a small python script to fix this in our project

Also checkout


Some of the IntelliJ shortcuts I use actively

cmd + ctrl + a — Open command panel

cmd + [ — Move back

cmd + ] — Move forward

cmd + shift + e — Show recently edit files

cmd + ctrl + g — Select all occurrences

cmd + 1 — Open project panel

cmd + shift + v — Show clipboard history

cmd + p — Show method parameters

cmd + shift + u — Change letter case

cmd + b — Go to implementation

cmd + option+ b — See all implementations

cmd + u — Super…


After Kotlin was made official by Google in the IO, we went ahead and gave it a shot for our Android app.

Pre: Our app is written in Java and uses Multidex.

So we decided to migrate one of our modules to Kotlin. Since existing modules are in Java, we had to call some part of the existing code.

Now, There happens to be this one class with a nested interface. The interface was never declared private.

We were calling this interface from our Kotlin code using SAM conversions.

Result: Our app crashed again and again with NoClassDefFound for MyClass$1

Everything Mobile by Rachit

#android @dream11

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