All Products
Search
Document Center

Mobile Platform as a Service:Quick start

Last Updated:Jan 22, 2026

This topic describes how to add the upgrade SDK related to the release management function. After adding the SDK and complete the necessary configurations, you can release a new version of an App in the mPaaS console, and the client can detect the new version through the upgrade API and remind users to download and upgrade.

Currently, Upgrade SDK supports integration through Native AAR and Component-based method.

The process includes the following four steps:

  1. Add SDK

  2. Configure project

  3. Initialize mPaaS (only for native AAR integration)

  4. Check for upgrades

Prerequisites

Add SDK

Native AAR method

In your project, use Component Management (AAR) to install the UPGRADE component. For more information, see Manage component dependencies.

Component-based method

In the Portal and Bundle projects, use Component Management to install the UPGRADE component. For more information, see Add component dependencies.

Configure project

Configure AndroidManifest

  1. Add the following permission to the AndroidManifest.xml file:

     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
  2. Add the following configuration to the AndroidManifest.xml file.

    Replace the wildcard character ${applicationId} with the actual package name. For example, replace ${applicationId}.fileprovider with com.mpaas.mobiledeliveryservice.fileprovider.

     <provider
     android:name="android.support.v4.content.FileProvider"
     android:authorities="${applicationId}.fileprovider"
     android:exported="false"
     android:grantUriPermissions="true">
     <meta-data
      android:name="android.support.FILE_PROVIDER_PATHS"
      android:resource="@xml/file_paths" />
     </provider>
    Note

    For more information about configuring AndroidManifest.xml, see App Manifest Overview.

  3. In the src/main/res/xml folder of your Portal project's main module, create a file named file_paths.xml with the following content:

     <?xml version="1.0" encoding="utf-8"?>
     <resources>
     <paths>
      <external-files-path
          name="download"
          path="com.alipay.android.phone.aliupgrade/downloads" />
      <external-path
          name="download_sdcard"
          path="ExtDataTunnel/files/com.alipay.android.phone.aliupgrade/downloads" />
     </paths>
     </resources>
    Note

    If your targetSdkVersion is greater than 24, you must add a new configuration. For more information, see Default storage path.

Add resources

Note

If you use the native AAR integration method, you must add the following resources to your application. Otherwise, the Upgrade component will not work correctly. Click here to download the resource files.

Merge the contents of the strings.xml, styles.xml, and colors.xml files with the corresponding files in the values folder.

Initialize mPaaS

If you use the native AAR integration method, you must initialize mPaaS.

Add the following code to the Application object:

public class MyApplication extends Application {
    
    @Override
    public void onCreate() {
        super.onCreate();
        // Initialize mPaaS
        MP.init(this);    
    }
}

For more information, see Initialize mPaaS.

Quickly check for upgrades

You can quickly check for a new version. This method only returns the check result:

MPUpgrade mMPUpgrade = new MPUpgrade();
// Synchronous method. Call it in a background thread.
int result = mMPUpgrade.fastCheckHasNewVersion();
if (result == UpgradeConstants.HAS_NEW_VERSION) {
  // A new version is available.
} else if (result == UpgradeConstants.HAS_NO_NEW_VERSION) {
  // No new version is available.
} else if (result == UpgradeConstants.HAS_SOME_ERROR) {
  // An error occurred.
}