Android Library Module vs Feature Module

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.


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:

  • https://developer.android.com/guide/playcore/dynamic-delivery
  • https://developer.android.com/topic/performance/reduce-apk-size