All Products
Search
Document Center

Mobile Platform as a Service:Quick start

Last Updated:Oct 20, 2025
Important
  • Android Nebula Mini Program will gradually stop maintenance. Please use the new container for mini programs. For more information about the integration, please refer to Quick start.

  • If you have already used Nebula Mini Program, we recommend that you migrate to the new mini program container so that you can continue to enjoy our high-quality services. Thank you for your understanding and support.

  • The new mini program container has been fully upgraded to provide more features including basic library 2.0, debug panel, plugins, etc., and is compatible with the new version of mPaaS Web kernel.

This section introduces how to use Mini Program in combination with the official Demo.

Note
  • You can access Mini Program SDK to Android client through Native AAR or Portal & Bundle accessing method. For more information, see the Accessing method introduction.

  • Mini Program is only available in 10.1.60 and higher baseline versions.

Prerequisites

Native AAR

  1. Add the mPaaS to your project.

  2. Add the Mini Program dependency. Install the Mini Program component through mPaaS Component Management (AAR) in the project.

Portal & Bundle

  1. Complete the mPaaS Portal & Bundle access process.

  2. Add the Mini Program dependency. Install the Mini Program component through mPaaS Component Management in the Portal and Bundle projects. For more information, see Manage component dependencies.

Procedure

The procedure of accessing Mini Program contains the following steps:

  1. Initialize configuration

    1. Initialize mPaaS

    2. Configure mini program signature verification

    3. Configure AndroidManifest

    4. Apply for UC kernel

  2. Release a mini program

    1. Enter the mini program background

    2. Configure virtual domain name

    3. Create a mini program

    4. Release the mini program

  3. Start the mini program

1. Initialize configuration

1.1 Initialize mPaaS

If you access Mini Program through Native AAR, you need to initialize mPaaS.You need to add the following code in Application:

public class MyApplication extends Application {
     
    @Override
    public void onCreate() {
        super.onCreate();
        
        MP.init(this,
            MPInitParam.obtain().setCallback(new MPInitParam.MPCallback() {
                @Override
                public void onInit() {
                    // Initialize the public resource package of the mini program          
                    H5Utils.setProvider(H5AppCenterPresetProvider.class.getName(),new TinyAppCenterPresetProvider());      
                }
            })
        );
    }
 
}

For more details, see Initialize mPaaS.

In onPostInit, the public resource packages are set as follows:

H5Utils.setProvider(H5AppCenterPresetProvider.class.getName(),new TinyAppCenterPresetProvider());
Note

If you cannot find the class TinyAppCenterPresetProvider, it may be that your baseline version is less than 10.1.68.7, please refer to Mini Program base library to process it.

1.2 Configure mini program signature verification

Create the file custom_config.json under the pathassets/config in the Android project, and enter the following content in the file.

[
  {
    "value": "NO",
      "key": "h5_shouldverifyapp"
  }
]

As for the value, NO means disabling the Mini Program signature verification while YES for enabling the Mini Program signature verification. It defaults to YES in case of no input. In the development and debugging stage, it is suggested to enable signature verification. For specific operations, see Configure Mini Program Package.

Configure the time interval for requesting mini program packages

mPaaS supports configuring the time interval for requesting mini program packages. You can set the time interval globally or individually.

  • Global setting: You can add the following code in custom_config.json:

    {
    "value": "{\"config\":{\"al\":\"3\",\"pr\":{\"4\":\"86400\",\"common\": \"864000\"},\"ur\":\"1800\",\"fpr\":{\"common\":\"3888000\"}},\"switch\":\"yes\ "}",
    "key": "h5_nbmngconfig"\
    }

    \"ur\":\"1800\" defines the global update interval, where 1800 is the default value, representing the time length in seconds. You can modify this value to set your global mini program package request interval which can be in the range of 0 ~ 86,400 seconds (namely 0 ~ 24 hours), and 0 means there is no limit on the request interval.

    Important

    Do not modify other parameters.

  • Individual setting: The interval setting only works on the current mini program package. You can log in to the mPaaS console, go to the Add Mini Program package > Extended information page, and fill in {"asyncReqRate":"1800"} to set the request time interval. For details, see the extended information in Create a Mini Program Package.

Verify if the time interval configuration works: You can open a project that has accessed the Mini Program, and filter the keyword H5BaseAppProvider in the logcat log. If you can find the following information, it means the configuration has taken effect.

lastUpdateTime: xxx updateRate: xxx

1.3 Configure AndroidManifest

If you access Mini Program through Native AAR, you need to add the following configuration in AndroidManifest.xml.

<application>
    ···
<meta-data android:name="nebula.android.meta.enable" android:value="true"/>
  ···
</application>

1.4 Apply for UC kernel

Before using the mini program, you need to apply for and configure the UC kernel. Without the UC kernel, you will not be able to use some capabilities of the Android mini program.

Note

Due to changes in product strategy, UC is no longer fully open for applications. Public application for UC Key will not be supported starting from 2022.12.01. You need to submit a UC Key application form, and the staff will review it and feedback the results of the application.

  1. Click mPaaS > Basic Tools > Generate UC Key Signature Information to open the Query Signature Information window.

  2. In the Query Signature Information window, fill in the relevant configuration information and click Next.

  3. Copy the obtained SHA1 information.

    image

  4. Fill in the Key you applied for in the previous step into the project's AndroidManifest.xml file:

    <meta-data android:name="UCSDKAppKey" android:value="The Key you applied for"/>
    Note

    The authorization information of UC SDK is bound to the package name and signature of the apk. Therefore, if UCWebView does not take effect, check whether the signature and package name are consistent with the information used when applying.

Using the UC kernel, mini programs can have the same layer capabilities, such as embedding webviews, embedding maps, etc., and have a better rendering experience.

2. Release a mini program

Before starting the mini program, you must release the mini program through the mPaaS console.

2.1 Enter the mini program background

Log in to the mPaaS console, enter the target application and select Mini Program > Release Mini Program from the left navigation pane.

2.2 Configure virtual domain name

If you are using Mini Program for the first time, please go to the Mini Program > Release Mini Program > Manage configuration page and configure the virtual domain name first. In principle, you need to use a second-level domain name managed by your company.

Note

Be sure to use a domain name that you registered yourself.

2.3 Create a mini program

Enter the mPaaS console, and complete the following steps:

  1. Click the Mini Program > Release Mini Program from the left navigation pane.

  2. On the mini program list page, click Create.

  3. In the Create New Mini Program popup, enter the mini program ID and name, then click Confirm. The mini program ID is a 16-digit number, for example 2018080616290001.

  4. In the mini program list, find the new mini program and click Add.

  5. In the Basic Information column, complete the following configuration:

    • Version: Fill in the version number of the mini program package, for example 1.0.0.0.

    • Client version range: Select the applicable Android client version range for the mini program. Only when the App is in the version range, can the Mini Program start, otherwise it cannot start. The minimum version can be 0.0.0 while the maximum version can be left empty. In such case, the Mini Program can start in the Android client of all versions.

      Note

      Ensure that the version is of the Android client, not the mini program.

    • Icon: Click Select a file to upload the icon of the mini program package. The icon is required when you create the mini program package for the first time. For example:

    • File: Upload the mini program package resource file which must be a .zip file. There is an mPaaS Mini Program demo for you (click here to download), you can upload it directly.

      Note

      Before you upload the .zip file, you should rename the zip file and the file in the zip to the 16-digit ID of your mini program.

  6. On the configuration information page, complete the following configuration:

    • Main entry URL: Required. It is the first page of the mini program package, in the format of /index.html#xxx/xxx/xxx/xxx, where xxx/xxx/xxx/xxx behind # is the first value in pages in the app.json of the mini program. As shown in the figure below, the main entrance of the mPaaS Mini Program demo is /index.html#page/tabBar/component/index.

      3

    • As for the other configurations, keep the default setting.

  7. Check I have confirmed that the above information is accurate and will not be modified once submitted.

  8. Click Submit.

2.4 Release the mini program

  1. Enter the Mini Program > Release Mini Program > Manage official package page from the left navigation pane.

  2. On the mini program list page, select the target Mini Program and corresponding version, click Create release task.

  3. On the release task creation page, complete the following settings:

    • Release type: select Official.

    • Release description: Optional

  4. Click OK to complete the release task creation.

3 Start the mini program

After finishing the above steps, you can execute the following code in the Android project to start the demo mini program.

MPNebula.startApp("2018080616290001");
Note

The 2018080616290001 in the code refers to the mini program ID. The ID here is fore reference only, you should enter the actual program ID in practice.