Android Library Module vs Feature Module

Nick Cardoso picture Nick Cardoso · May 23, 2017 · Viewed 8.7k times · Source

The latest update of Android Studio 3.0 allows creation of several module types. One of the new types is 'Feature Module' but I can't find details about it

What is the difference between the existing Android Library Module and the Feature Module and why should I use the latter?

The only difference I can see is that a Feature module defines an Application in the manifest. Can/should these Features be used as standalone apps? In what way do they differ from the actual Application module in that case?

Answer

mansi rao picture mansi rao · Dec 18, 2017

Feature modules are used in Instant apps and Android App Bundles so that when app requests a feature while using the instant app or App Bundles, the Play store loads only requested feature module code, and not others. In the case of Instant apps, once the user is done using the feature the code is discarded. If you are working on a regular app and not instant app, I think you should be using Android library module.

Android App Bundles will be used to break up your app into small chunks so that a user doesn't have to download all of the code in your APK if they don't need it.