Support dynamic delivery solution in SDK

IAPMiniProgram SDK designs a unified module dynamic delivery solution that allows the super app to download and install the required modules per your requirements to run your applications.

For example, in order to enhance the performance and rendering capability of mini programs, MYWeb module/dynamic feature is supported, the Google map SDK dynamic integration is supported, and so on.

Prerequisite

Make sure that the following dynamic module names are used correctly according to the different features:

Feature

Module name

Notes

MYWeb feature

mywebdynamicfeature

Google Maps SDK integration

mapdynamicfeature

Video component integration

videodynamicfeature

Note:

When either the video or multi-media component is dynamically integrated, you cannot integrate both components simultaneously.

Multi-media component integration

mediadynamicfeature

Step 1. Create the dynamic module

  1. In your project, click Create new module > Dynamic Feature to start creating a new module. (see the following figure).
  2. Choose the Base Application Module properly.
  3. Fill in the module name correctly according to the different features.
    • For MYWeb feature
      image.png
    • For Google Maps SDK integration
      截屏2025-12-29 17.00.18.png
    • For Video component integration
      截屏2026-01-30 10.53.20.png

    • For Multi-media component integration
      截屏2026-01-30 10.55.17.png
  1. Fill in the Module title according to the different features.
  • For MYWeb feature, by default, "MyWeb Dynamic Feature" is used .image.png
  • For Google Maps SDK integration, you can directly choose the "Map Dynamic Feature".
    截屏2025-12-29 19.06.11.png
  • For Video component integration, you can directly choose the "Video Dynamic Feature".
    截屏2026-01-30 10.57.39.png
  • For Multi-media component integration, you can directly choose the "Media Dynamic Feature".
    截屏2026-01-30 10.57.10.png
  1. Note: In the Install-time inclusion drop-down list, choose (on-deman only).
  2. Click Finish to finish creating the module.

Step 2. Confirm the correctness of the AndroidManifest file

The default configurations in the AndroidManifest file are generated by the system. You need to check and confirm the correctness of the file.

Note: change the dist:titleaccording to the different features.

Feature

Module name

MYWeb feature

"@string/title_mywebdynamicfeature"

Google Maps SDK integration

"@string/title_mapdynamicfeature"

Video component integration

"@string/title_videodynamicfeature"

Multi-media component integration

"@string/title_mediadynamicfeature"

Code sample:

copy
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:dist="http://schemas.android.com/apk/distribution">

  <dist:module
    dist:instant="false"
    dist:title="@string/title_mywebdynamicfeature">
    <dist:delivery>
      <dist:on-demand />
    </dist:delivery>
    <dist:fusing dist:include="true" />
  </dist:module>
</manifest>

Step 3. Confirm the dynamic repository is imported into the main module

  1. In the build.gradle file of the project app, the system generates the following code by default according to the different features. This is because that you choose the Base Application Module in the previous Step 1.
    • For MYWeb feature
copy
android {
    dynamicFeatures = [':mywebdynamicfeature']
}
    • For Google Maps SDK integration
copy
android {
    dynamicFeatures = [':mapdynamicfeature']
}
    • For Video component integration
copy
android {
    dynamicFeatures = [':videodynamicfeature']
}
    • For Multi-media component integration
copy
android {
    dynamicFeatures = [':mediadynamicfeature']
}
  1. In order to make the dynamic module take effects, must add the following codes in the build.gradle file:
copy
android {
    packagingOptions {
        jniLibs {
            useLegacyPackaging true
        }
    }
}
  1. In the AndroidManifest.xml file of the project app, add the following code according to the different features.
    • For MYWeb feature
copy
<meta-data
  android:name="com.alibaba.griver.dynamic.modules"
  android:value="mywebdynamicfeature" />
    • For Google Maps SDK integration
copy
<meta-data
  android:name="com.alibaba.griver.dynamic.modules"
  android:value="mapdynamicfeature" />
    • For Video component integration
copy
<meta-data
  android:name="com.alibaba.griver.dynamic.modules"
  android:value="videodynamicfeature" />
    • For Multi-media component integration
copy
<meta-data
  android:name="com.alibaba.griver.dynamic.modules"
  android:value="mediadynamicfeature" />

Step 4. Import the dependency to support the dynamic feature

Import the dependency in the following files:

  1. In the build.gradle file of the project app, add the following codes to import the iapminiprogram-dynamic-feature dependency.
    Note: Check the latest iapminiprogram_version version in the Android Release Notes.
copy
dependencies {
    implementation "com.alipay.plus.android:iapminiprogram-dynamic-feature:${iapminiprogram_version}"
}

  1. In the build.gradle file of the dynamic module, add the following codes according to the different features.
    • For MYWeb feature, import the iapminiprogram-myweb dependency.
copy
dependencies {
    implementation "com.alipay.plus.android:iapminiprogram-myweb:${iapminiprogram_version}"
}
    • For Google Maps SDK integration, import the iapminiprogram-gmultimap dependency.
copy
dependencies {
    implementation "com.alipay.plus.android:iapminiprogram-gmultimap:${iapminiprogram_version}"
}
    • For video component integration, import the iapminiprogram-video dependency.
copy
dependencies {
    implementation "com.alipay.plus.android:iapminiprogram-video:${iapminiprogram_version}"
}
    • For Multi-media component integration, import the iapminiprogram-media dependency.
copy
dependencies {
    implementation "com.alipay.plus.android:iapminiprogram-media:${iapminiprogram_version}"
}

Step 5. Configure to use the SplitCompat tool

In order to use the SplitCompat tool, need to finish the following configurations:

  1. In the build.gradle file of the project app, add the following codes to import dependencies accordingly:
copy
// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // So, make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:feature-delivery:2.1.0'

    // For Kotlin users, also add the Kotlin extensions library for Play Feature Delivery:
    implementation 'com.google.android.play:feature-delivery-ktx:2.1.0'
    ...
}
  1. Turn on the SplitCompat in your application based on the following different cases.

Case

To do

If you have a customized application

You need to add the following codes in the attachBaseContext() function of your current application:

copy
public class MyApplication extends Application {
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        SplitCompat.install(this);
    }
}

If you do not have a customized application

You need to define a new application as the following codes, which inherits SplitCompatApplication.

copy
public class MyApplication extends SplitCompatApplication {
    ...
}

Step 6. (Optional, for MYWeb only) Optimize the MyWeb dynamic download experience

If you want to optimize the MYWeb dynamic download experience, for example whether a custom dialog box is displayed to explain the reason for downloading, knowing the download status, and so on, to achieve these experiences, use the GriverDynamicFeatureExtension interface.