We have created a demand dynamic module, this module just have the functionality of printing the data through a thermal printer, it doesn't have any activity. We need to access the classes and functions of this on demand module in our base code. Is it possible? if yes how can we access the code of the dynamic module in our base app after installing the dynamic module.
Asked
Active
Viewed 780 times
0
-
What is a "dynamic module" for you? In Android Studio a Module is just a library which provides Classes and Resources and can be accessed as usual: packagename.class.inner_class.method – emandt Apr 06 '21 at 08:43
1 Answers
0
Code defined in on-demand module is not accessible from the main module, because it doesn't have on-demand module as a usual dependency. Although it is possible to access the code using reflection or dependency injection.
More info on the subject can be found here: https://medium.com/androiddevelopers/patterns-for-accessing-code-from-dynamic-feature-modules-7e5dca6f9123

a.toropov
- 218
- 2
- 11