(Dis-) Advantage of having multiple modules in an Android Studio Project?

It is of great advantage to have multiple modules rather than to create a single large app-module. Following are the key points:

  1. If you find the compile time is taking longer then you can disable the module from gradle you are not working upon temporarily and compile it faster.
  2. A module helps us to divide project into discrete units of functionality also. You can create one data module which contains all pure java beans and can be used by multiple app if you are in same domain. Eg. Finance domain can have two applications one for viewing policies for customer and other can be for an insurance agent for viewing the same data. But the data module can be shared across all apps and even the data module can be borrowed from server or API team. Data module can be tested individually without any android dependencies and any one knows about java can write test cases.
  3. Each module can be independently build, tested, and debugged.
  4. Additional modules are often useful when creating code libraries within your own project or when you want to create different sets of code and resources for different device types, such as phones and wearables, but keep all the files scoped within the same project and share some code.
  5. Also Android app module and Library module are different.
  6. You can keep two different versions of module based on the API releases as from ASOP.

You can have a look for more on android developer resource

How modularization can speed up your Android app’s built time

App modularization and module lazy loading at Instagram and beyond

Modularizing Android Applications by Mauin

Survey on how Android developers were modularising their apps

Leave a Comment