tencent cloud

Extension SDK
Last updated: 2025-11-13 15:27:10
Extension SDK
Last updated: 2025-11-13 15:27:10
A mini program's main SDK (mini_core) provides the basic runtime capabilities of the mini program. In addition to mini_core, the mini program SDK also offers the following extension components, which can be integrated to the superapp as needed.

QR code scanning extension SDK

Component description: If your mini program uses the QR code scanning capability, you need to add the following SDK to support the scanning feature.
Integration method: Add the QR code scanning extension library dependency as follows.
// QR code scanning extension component
implementation 'com.tencent.tcmpp.android:mini_extra_qrcode:${version}' // For version information, see Android SDK Updates
After the QR code scanning extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.scanCode
Opens the client’s QR code scanning interface
Required permissions:
Permission
Description
Camera
Camera permission is required for QR code scanning.
File read/write
File read/write permissions are required to recognize QR codes in local images.

Tencent Maps extension SDK

Component description: Developed for apps in the Chinese mainland. If your mini program uses the map capabilities, you need to add the following SDK.
Integration method: Add the map extension library dependencies as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_map:${version}'// For version information, see Android SDK Updates
Implementation 'com.tencent.map:tencent-map-vector-SDK:5.9.0' // For version information, see Tencent Maps Documentation
implementation 'com.tencent.map:sdk-utilities:1.0.9'
implementation 'com.tencent.map.geolocation:TencentLocationSdk-openplatform:7.6.1.3'
You need to configure the project in the Tencent Location Service console and obtain the API key required to access the Tencent Maps service. For detailed steps, see Development Guide.
Once you've completed the above steps, you need to configure your API key in the Android project. Add the following meta-data in the AndroidManifest.xml file, and replace (YOUR_API_KEY) with your actual API key:
<application
...
<meta-data
android:name="TencentMapSDK"
android:value="(YOUR_API_KEY)" />
...
</application>
After the Tencent Maps extension SDK is added, the supported mini program APIs are as follows:
API name
Description
Map
Supports map APIs, including map display, location selection, POI query, offline map, and custom tile, etc.
Required permissions:
Permission
Description
Location
Required to use location services for displaying map locations.
The offline map feature can be customized by overriding the configData method in BaseMiniAppProxyImpl and intercepting calls where configType is MiniConfigData.TYPE_OFFLINE_MAP.
Example:
@Override
public MiniConfigData configData(Context context, int configType, JSONObject params) {
if (configType == MiniConfigData.TYPE_OFFLINE_MAP) {
MiniConfigData.OfflineMapConfig offlineMapConfig = new MiniConfigData.OfflineMapConfig();
// Set whether to enable the offline map feature. Default is false. It can be set to true based on business requirements.
offlineMapConfig.enabled = true;
return new MiniConfigData
.Builder()
.offlineMapConfig(offlineMapConfig)
.build();
}

return new MiniConfigData
.Builder()
.build();
}


Google Maps and Petal Maps extension SDKs

Component description: Developed for apps outside the Chinese mainland. If your mini app uses map capabilities, you need to add the following SDK.
Integration method: Add the map extension library dependencies as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_google_map:${version}'// For version information, see Android SDK Updates
implementation 'com.google.android.gms:play-services-maps:18.1.0' // For version information, see Google Maps Documentation (public network access required)
implementation 'com.google.maps.android:android-maps-utils:2.3.0'
Since some Huawei devices do not support embedded Google Maps, the map may not be displayed. You can integrate Petal Map as a supplementary solution, and the mini program framework will prioritize the use of Petal Map on Huawei devices.
repositories {
maven {url 'https://developer.huawei.com/repo/'}
}
implementation 'com.tencent.tcmpp.android:mini_extra_huawei_map:${version}'// For version information, see Android SDK Updates
implementation 'com.huawei.hms:maps:6.9.0.300' // For version information, seePetal Maps Documentation
implementation 'com.huawei.hms:maps-basic:6.9.0.300'
implementation 'com.huawei.hms:site:6.5.1.300'
For Google Maps, you need to configure the Google Cloud project in the Google Cloud console and obtain the API key required to access the Google Maps service. For detailed steps, see Setup in the Cloud Console and Use API Keys.
Once you've completed the above steps, you need to configure your API key in the Android project. Add the following meta-data in the AndroidManifest.xml file, and replace (YOUR_API_KEY) with your actual API key:
<application
...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="(YOUR_API_KEY)" />
...
</application>
For Petal Maps, you need to create a project in the Petal Maps console, activate the map and location services, and obtain the API key used to access the location service. For detailed steps, see Configuring App Information in AppGallery Connect. Then follow the guide of Integrating the HMS Core SDK to download the “agconnect-services.json” file to your project and configure the Huawei AGC plugin.
To use Huawei's location service properly, you need to add the following meta-data to the AndroidManifest.xml file and replace (YOUR_API_KEY) with your actual key:
<application
...
<meta-data
android:name="HuaweiApiKey"
android:value="(YOUR_API_KEY)" />
...
</application>
Note:
For security purpose, it is recommended to request a separate API key for location services.
After the Google Maps and Petal Maps extension SDKs are added, the supported mini program APIs are as follows:
API name
Description
Map
Supports map APIs and components, including map display, location selection, and POI query, etc.
Required permissions:
Permission
Description
Location
Required to use location services for displaying map locations.

Live streaming component extension SDK

Component description: If you need to use the live streaming components (live-player and live-pusher) for developing capabilities of live streaming push and pull, you need to add the following SDKs.
Integration method: Add the live streaming component dependencies as follows.
// Live streaming component support library
implementation 'com.tencent.tcmpp.android:mini_extra_trtc_live:${version}'// For version information, see Android SDK Updates
// If you only need to integrate the live streaming component library, use the following lightweight dependency.
implementation 'com.tencent.liteav:LiteAVSDK_Live:latest.release' // For version information, see Tencent Cloud Documentation
// If you need to integrate the live streaming component library and advanced player component library, use the following full dependency verions
implementation 'com.tencent.liteav:LiteAVSDK_Professional_Player_Premium:latest.release // For version information, see Tencent Cloud Documentation
In addition to adding the above dependencies, you need to override the following methods of implementing baseminiAppProxyImpl and provide the licenseURL and licenseKey required for the live streaming component. This is necessary to complete the initialization configuration for the live streaming component. If you do not configure the correct LicenseUrl and LicenseKey, the live streaming component will not function properly.
Note:
For the method of obtaining the LicenseURL and LicenseKEY, see Adding and Renewing a License.
@ProxyService(proxy = MiniAppProxy.class)
public class MiniAppProxyImpl extends BaseMiniAppProxyImpl {
@Override
public MiniConfigData configData(Context context, int configType, JSONObject params) {
if(configType == MiniConfigData.TYPE_LIVE) {
// Live streaming configuration
MiniConfigData.LiveConfig liveConfig = new MiniConfigData.LiveConfig();
// The following key and URL are used for demo only
liveConfig.licenseKey = "";
liveConfig.licenseUrl = "";

return new MiniConfigData
.Builder()
.liveConfig(liveConfig)
.build();
}

return null;
}
}
After the live streaming extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.createLivePusherContext
Creates the live streaming pusher context.
LivePusherContext
Supports LivePusherContext APIs.
wx.createLivePlayerContext
Creates a live streaming player context.
LivePlayerContext
Supports LivePlayerContext APIs.
live-pusher
Tag for live streaming push.
live-player
Tag for live streaming play.
Required permissions:
Permission
Description
Camera
-
Recording
-

LBS extension SDK

Component description: The LBS component provides capabilities related to location information, compass, accelerometer, positioning, and device motion.
Integration method: Add the LBS extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_lbs:${version}'// For version information, see Android SDK Updates
After the LBS extension SDK is added, the supported mini program APIs are as follows:
API name
Description
Location information
Supports location information APIs.
Compass
Supports compass APIs.
Accelerometer
Supports accelerometer APIs.
Device motion
Supports device motion APIs.
Gyroscope
Supports gyroscope APIs.
Required permissions:
Permission
Description
Location
Required to obtain the location.

Bluetooth extension SDK

Component description: After the Bluetooth extension library is added, you can use Bluetooth APIs.
Integration method: Add the Bluetooth extension library dependency as follows:
implementation 'com.tencent.tcmpp.android:mini_extra_bluetooth:${version}'// For version information, see Android SDK Updates
After the LBS extension SDK is added, the supported mini program APIs are as follows:
API
Description
Bluetooth - general-purpose
General-purpose Bluetooth API.
Bluetooth - Low Energy (BLE) peripheral device
Bluetooth Low Energy (BLE) peripheral devices APIs.
Bluetooth-Low Energy (BLE) central device
Central device APIs.
Bluetooth-beacon
Bluetooth beacon APIs.
Required permissions:
Permission
Description
Bluetooth
Required to operate the Bluetooth.
Location
Required to search the Bluetooth device.

NFC extension SDK

Component description: The NFC extension SDK can be added to enable NFC read/write capabilities.
Integration method: Add the NFC extension SDK dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_nfc:${version}'// For version information, see Android SDK Updates
After the NFC extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.getNFCAdapter
Gets the NFC operation management instance object.
NFCAdapter
Supports NFCAdapter APIs.
NFC instances (NFCA, NFCB, NFCV, NFCF, NDEF, IsoDep, MifareUltralight, MifareClassic)
Supports NFC tag instance APIs.
Required permissions:
Permission
Description
NFC
Required to access NFC capabilities.

Biometric authentication extension SDK

Component description: Biometric authentication extension SDK provides capabilities related to device fingerprinting and face recognition.
Integration method: Add the biometric authentication extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_soter:${version}'// For version information, see Android SDK Updates
After the biometric authentication extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.startSoterAuthentication
-
wx.checkIsSupportSoterAuthentication
-
wx.checkIsSoterEnrolledInDevice
-
Required permissions:
Permission
Description
Fingerprint access
Required to access fingerprint authentication.

Clipboard extension SDK

Component description: Provides clipboard access capability.
Integration method: Add the extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_clipboard:${version}'// For version information, see Android SDK Updates
After the LBS extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.getClipboardData
-
wx.setClipboardData
-
Required permissions:
Permission
Description
Clipboard
Required to access and modify clipboard data.

Contacts extension SDK

Component description: Provides capabilities for accessing contacts.
Integration method: Add the extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_contact:${version}'// For version information, see Android SDK Updates
After the contacts extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.addPhoneContact
Adds a contact.
wx.chooseContact
Selects a contact.
Required permissions:
Permission
Description
Contacts read/write permission
Required to access and write contacts information.

PDF extension SDK

Component description: Provides the capability to open PDF documents.
Integration method: Add the extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_pdf:${version}'// For version information, see Android SDK Updates
After the PDF extension SDK is added, the supported mini program APIs are as follows:
API name
Description
wx.openDocument
Opens the document (PDF format only).

Media extension SDK

Component description: Provides default implementations for chooseMedia and previewMedia. Starting from version 1.5.9, a lite version has been added that uses the system image picker to eliminate the need for READ_MEDIA_IMAGES and READ_MEDIA_VIDEO permissions. The lite version and the non-lite version are mutually exclusive, and integrating both will result in compilation errors. Please choose the appropriate version based on your needs.
Non-lite version:
The media selection feature in the non-lite version is implemented by the SDK and relies on system media selection permissions. It includes image and video preview features. However, Google Play has strict policies regarding media permissions. Unless necessary, it is recommended to choose the lite version. For details, see:Google Play's Photo and Video Permissions policy.
implementation 'com.tencent.tcmpp.android:mini_extra_media_support:${version}'// For version information, see Android SDK Updates
Lite version:
The lite version directly uses the system's media selection feature, with a UI and interactions consistent with the system, without requiring media permissions.
implementation 'com.tencent.tcmpp.android:mini_extra_media_support_lite:${version}'// For version information, see Android SDK Updates
Implement the MediaImageLoaderProxy, use a custom image loading implementation for image loading in the mini_extra_media_support library.
Note:
You can also implement the MediaChooseJsProxy to customize the logic for chooseMedia.
@ProxyService(proxy = MediaImageLoaderProxy.class)
public class CustomMediaImageLoaderProxy implements MediaImageLoaderProxy {
private GlideImageEngine glideImageEngine = new GlideImageEngine();

@Override
public ImageEngine getCustomImageEngine() {
return glideImageEngine;
}

static class GlideImageEngine implements ImageEngine {

@Override
public void loadPhoto(@NonNull Context context, @NonNull Uri uri, @NonNull ImageView imageView) {
Glide.with(context).load(uri).transition(withCrossFade()).into(imageView);

}

@Override
public void loadGifAsBitmap(@NonNull Context context, @NonNull Uri gifUri, @NonNull ImageView imageView) {
Glide.with(context).asBitmap().load(gifUri).into(imageView);

}

@Override
public void loadGif(@NonNull Context context, @NonNull Uri gifUri, @NonNull ImageView imageView) {
Glide.with(context).asGif().load(gifUri).transition(withCrossFade()).into(imageView);

Mini game extension SDK

Component description: Provides the implementation for the mini game engine.
Integration method: Add the extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_mbengine:${version}'// For version information, see Android SDK Updates
After the extension library is added, mini games are supported. For mini game APIs, see API Overview.

Google ads extension SDK

Component description: Provides Google AdMob ad loading capability.
Integration method: Add the extension library dependency as follows.
implementation 'com.tencent.tcmpp.android:mini_extra_admob:${version}'// For version information, see Android SDK Updates
Note:
This feature depends on AdMob. Please integrate it according to the official documentation first. For more information, see AdMob > Mobile Ads SDK (Android) > Get Started.

The mini program framework operates on a multi-task, multi-process architecture, with mini programs running in independent processes. Since AdMob does not support multi-process by default, the ad extension library has been adapted by modifying the declaration of AdMob's AdActivity. The details are as follows:
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:exported="false"
android:taskAffinity=":admob"
android:excludeFromRecents="true"
android:multiprocess="true"
android:theme="@android:style/Theme.Translucent"
tools:ignore="MissingClass" />
Modified field
Purpose and impact
Removable?
android:multiprocess="true"
Purpose:
Allows AdActivity to run in the calling process, enabling the mini program process to use AdMob ads.
Impact:
This attribute only affects the child process calling AdMob ads; it does not affect the main process.
No, removing it will prevent the mini programs and mini games from displaying ads properly.
android:taskAffinity=":AdMob"
Purpose:
AdMob adds the FLAG_ACTIVITY_NEW_TASK flag when a banner ad is clicked, causing AdActivity to be pushed into the superapp's main task stack instead of the mini program's task stack. As a result, when returning from the target page, users first return to the superapp’s main task stack and cannot navigate back to the mini program page properly. Adding this attribute allows AdActivity to be pushed onto an independent task stack, enabling normal navigation back to the mini program page.
Impact:
1. AdMob does not add FLAG_ACTIVITY_NEW_TASK when displaying rewarded video ads, so those ads are unaffected.
2. Banner ad target pages will have a separate task stack, which may affect the final return logic if users switch tasks through the recent tasks list.
Removable, but removing it will prevent normal navigation back to the mini program page from the banner ad target page.
android:excludeFromRecents="true"
Purpose:
Since AdActivity may only serve as a transitional page, it could display a black screen task in the recent tasks list when pushed onto a new task stack. This attribute prevents the display of that black screen task.
Impact:
If AdActivity is the root page of the task stack, it will not be shown in the recent tasks list, which may lead to activity leaks in some scenarios.
Removable, but removing it may result in a black screen task being displayed in the recent tasks list.

Advanced player component extension SDK

Component description: To play DRM-encrypted videos, you must integrate this extension library into your superapp and configure the relevant properties within the mini program.
Note:
The default preloading size is 2 MB.
In scenarios where the video auto-plays, the default buffer size is set to 30 seconds multiplied by the video bitrate.
In scenarios where the video does not auto-play, the default preloading size of 2 MB is loaded first, followed by a default buffer size of 5 MB.
Integration method: Add the advanced player component dependency as follows.
// Advanced player component support library
implementation 'com.tencent.tcmpp.android:mini_extra_video:${version}'// For version information, see Android SDK Updates
// If you only need to integrate the advanced player component library, use the following lightweight dependency version.
implementation 'com.tencent.liteav:LiteAVSDK_Player_Premium:latest.release' // For version information, see Tencent Cloud Documentation
// If you need to integrate the advanced player component library and live streaming component library, use the following full dependency version.
implementation 'com.tencent.liteav:LiteAVSDK_Professional_Player_Premium:latest.release // For version information, see Tencent Cloud Documentation
In addition to adding the above dependencies, you need to override the following methods of implementing baseminiAppProxyImpl and provide the licenseURL and licenseKey required for the advanced player component. This is necessary to complete the initialization configuration for the advanced player component. If you do not configure the correct LicenseUrl and LicenseKey, the advanced player component will not function properly. (The configuration method for the advanced player component is the same as that for the live streaming component.)
Note:
For the method of obtaining the LicenseURL and LicenseKEY, see Adding and Renewing a License. (Requires purchase of a version supporting DRM capabilities)
@ProxyService(proxy = MiniAppProxy.class)
public class MiniAppProxyImpl extends BaseMiniAppProxyImpl {
@Override
public MiniConfigData configData(Context context, int configType, JSONObject params) {
if(configType == MiniConfigData.TYPE_LIVE) {
// Configure the advanced player SDK for the video component
MiniConfigData.LiveConfig liveConfig = new MiniConfigData.LiveConfig();
// The following key and URL are used for demo only
liveConfig.licenseKey = "";
liveConfig.licenseUrl = "";

return new MiniConfigData
.Builder()
.liveConfig(liveConfig)
.build();
}

return null;
}
}
After adding the advanced player extension SDK, the newly supported properties for the video component in mini programs are as follows:
API name
Description
is-drm
Whether it is a DRM-type video source.
provision-url
Certificate provider URL.
license-url
Decryption key URL.
Required permissions:
Network permissions, storage permissions
To configure obfuscation rules:
In the proguard-rules.pro file, add LiteAVSDK classes to the "do not obfuscate" list.
-keep class com.tencent.liteav.** { *; }
Network security configuration allows the app to send HTTP requests.
For security reasons, starting from Android P (Android 9.0), Google requires that all app requests use encrypted connections. The player SDK initiates a local server to proxy HTTP requests. If your app's targetSdkVersion is 28 or higher, you can set it in the network security configuration to enable sending HTTP requests to 127.0.0.1. Otherwise, during playback, a "java.io.IOException: Cleartext HTTP traffic to 127.0.0.1 not permitted" error will occur, preventing video playback. The configuration steps are as follows:
Create a new file res/xml/network_security_config.xml in the project to set up the network security configuration.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>
Add the following properties within the application tag in the AndroidManifest.xml file.
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:networkSecurityConfig="@xml/network_security_config"
... >
...
</application>
</manifest>



Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback