2

I'm starting to use dynamic feature module and I have some doubts about how I shared information between modules

For example:

Login Module
- Make a call to the server and get a token to make the other requests
- Get a user session

Movies Module
- Make a request to the server but needs the token that was obtained in the login module

Is there any way that the app project knows dynamic feature module, because dependency realization is inverse

Login Module <-- app
Movies Module <-- app

Through this dependency relationship I could not call a login module class from the movie module

Thank you for your answers.

Woz
  • 350
  • 7
  • 13

1 Answers1

0

You can add sub-module in the main module like I added linkedin-sdk module in my main module.

Just add sub-module in settings.gradle.kts & build.gradle (module level) files. setting.gradle.kts file

include(":app", ":linkedin-sdk")

build.gradle file

implementation(project(":linkedin-sdk"))

In your case, if you want to access all data of login module then you have to make login module as a sub-module.

Note: It is an example of build.gradle.kts

Akshay Raiyani
  • 1,243
  • 9
  • 21