
Dynamic Feature Module - On-Demand Delivery Guide
Dynamic Feature Module - On-Demand Delivery Guide Reduce initial app size by delivering features on-demand using Google Play's dynamic feature modules. Module Setup Create a dynamic feature module in build.gradle.kts : plugins { id ( "com.android.dynamic-feature" ) id ( "kotlin-android" ) } android { namespace = "com.example.dynamicfeature" compileSdk = 34 } dependencies { implementation ( project ( ":app" )) implementation ( libs . bundles . compose ) } In AndroidManifest.xml : <manifest> <dist:module dist:instant= "false" dist:onDemand= "true" dist:fusing dist:fusionPolicy= "never" > <application> <activity android:name= ".DynamicFeatureActivity" /> </application> </dist:module> </manifest> Base Module Integration In app's build.gradle.kts : dynamicFeatures = [ ":dynamicfeature" ] In AndroidManifest.xml : <uses-permission android:name= "com.google.android.finsky.permission.BIND_GET_INSTALL_STATE" /> Request Installation class DynamicFeatureViewModel ( private val splitInstallManager
Continue reading on Dev.to Tutorial
Opens in a new tab




