I decided to try multi-module Android app architecture and I've been experimenting with for a while.
For navigating between features, it is recommended to use Deep Linking in several articles.
I was wondering if anyone else has a different approach without using Deep Linking that won't cause dependency cycle.
This is the structure of my app. base
module has shared pieces and all modules depend on base
module. And app
module is the top-level module that connects all my features.
Multi-module architecture is a way of arranging code and packages in your project but on a broader view. Usually, when you create a project, you would work in a single module, but also we can create more modules within the same app.
A project with multiple Gradle modules is known as a multi-module project. In a multi-module project that ships as a single APK with no feature modules, it's common to have an app module that can depend on most modules of your project and a base or core module that the rest of the modules usually depend on.
A navigation graph is a resource file that contains all of your app's destinations along with the logical connections, or actions, that users can take to navigate from one destination to another. You can manage your app's navigation graph using the Navigation Editor in Android Studio.
Dynamic feature modules allow you to separate certain features and resources from the base module of your app and include them in your app bundle. Through Dynamic Delivery, users can later download and install those components on demand after they've already installed the base APK of your app.
You can create a router in the App module and an interface that it implements in the base module. Each feature module will reference the interface since they already have the dependency on the base module. App module will create the router and inject it into the feature modules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With