1

I have one very big android app module. For instance app features I want to divide the big module into the small many modules. App module have certain color,string and styles property that needs to be common between all the new module that I am creating. How to create the common style, and string xml?

Muhammad chhota
  • 1,837
  • 2
  • 16
  • 27

2 Answers2

5

Put every Resource in your base feature, as stated in the documentation:

To reduce the size of your apps, you must separate out the code and resources for individual features into separate feature modules. To optimize code reuse between your regular app and instant app, we recommend that you create a corresponding feature module for each feature plus a base feature module.

enter image description here

Ariel Carbonaro
  • 1,529
  • 1
  • 13
  • 25
0

Please read this to understand how the base feature module contains shared resources, such as activities, fragments, and layout files:

If your instant app has multiple features, then the base feature APK typically contains shared resources and code files that other features depend on. Following the map instant app example, the base APK might contain the map app's base styles.xml file or a data structure class for modeling locations and points of interest. The base feature APK is always downloaded regardless of what feature is requested by the user.

Tip: referencing base resources is different in Android Instant Apps, you can check:

I would also recommend you to import and check sample project structure “hello-multi-feature” for further clarifications: https://github.com/googlesamples/android-instant-apps

TWL
  • 6,228
  • 29
  • 65
ManmeetP
  • 801
  • 7
  • 17