Android Library Module vs Feature Module

Viewed 10949

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?

2 Answers

Maybe a litte updated version...

Android Library is for instance a feature that u will need in your app but maybe using in other Apps as well. This is basically a constant part of your application.

The Dynamic Feature Module (or Instant Dynamic Feature Module for Instant Apps) can be used for temporary or feature based applications. Let's say you have an Onboarding Process that requires a 80MB library scan module. So, when the user enters the onboarding the module will be requested and installed. Once the user finished your onboarding process the scan module isn't needed anymore, so you can remove the module again from your app.

An other example: You created an app with subscription based features. As the user payed for your subscription.. 3 of 8 modules (features) are now accessible for the user and the feature/module is being installed on the users device.

So in conclusion, it might be wise or even necessary (max. APK sized reached) to use dynamic features to reduce your apps size.

Also see:

Related