Android Library Module vs Feature Module

10,288

Solution 1

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.

Solution 2

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:

Share:
10,288
Nick Cardoso
Author by

Nick Cardoso

"If you can't explain the reasoning for your answer simply, you don't understand the subject well enough." (?)

Updated on June 03, 2022

Comments

  • Nick Cardoso
    Nick Cardoso almost 2 years

    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?

  • IgorGanapolsky
    IgorGanapolsky over 5 years
    What are Instant Apps used for?
  • lfree
    lfree over 5 years
    Instant Apps could be used for anything, just as your "native" apps. They are different in that Instant App are loaded "on the air" as a web page instead of from the phone storage.