All Products
Search
Document Center

Mobile Platform as a Service:Loading framework and customization

Last Updated:Feb 06, 2026

The mPaaS Android framework provides a complete loading process that helps development teams create applications for multiple lines of business. This topic describes the framework's startup flow and explains how to add your code to the startup process.

Startup flow

Application

A standard Android APK runtime first loads the Application class specified in the android:name attribute. This attribute is located in the application node of the AndroidManifest file.

The mPaaS Android framework rewrites this loading flow. You must set the android:name attribute to the framework's com.alipay.mobile.quinox.LauncherApplication class.

<application
    android:name="com.alipay.mobile.quinox.LauncherApplication"
    android:allowBackup="true"
    android:debuggable="true"
    android:hardwareAccelerated="false"
    android:icon="@drawable/appicon"
    android:label="@string/name"
    android:theme="@style/AppThemeNew" >
</application>

Startup page

Loading the framework bundle can take time. A startup page is required to wait for the framework to initialize before navigating to the application's home page. For this reason, you must configure the com.alipay.mobile.quinox.LauncherActivity provided by the framework as the application's startup page in the AndroidManifest file.

The configuration is as follows:

<activity
android:name="com.alipay.mobile.quinox.LauncherActivity"
android:configChanges="orientation | keyboardHidden | navigation"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

The mPaaS startup process is encapsulated to simplify development and prevent accidental changes, deletions, or interference. As a result, the LauncherApplication and LauncherActivity classes are not directly visible to developers.

mPaaS provides the LauncherApplicationAgent and LauncherActivityAgent agents. These agents allow the client application to run its own initialization logic during startup. You can inherit these two classes and implement your initialization logic in the corresponding callbacks. If you define these classes in a bundle project, you must configure ProGuard to prevent their obfuscation. For more information, see Obfuscate Android files.

Startup flowchart

The mPaaS Android framework loads as follows:image

  1. After the framework starts, the main thread creates the LauncherActivity startup page. It then calls the preInit method of LauncherActivityAgent.

  2. The framework performs multidex. During this process, it calls the preInit method of LauncherApplicationAgent. It reads the description file for each bundle in the current APK file. It then creates a class loader for each bundle and loads its resource files.

  3. After initialization is complete, the framework calls the postInit methods of LauncherActivityAgent and LauncherApplicationAgent.

Customization

The framework automatically creates two classes in the Launcher project: MockLauncherApplicationAgent and MockLauncherActivityAgent. These classes inherit from the LauncherApplicationAgent and LauncherActivityAgent classes. During framework initialization, these classes are called from LauncherApplication and LauncherActivity.

The following code shows the configuration in the Portal's AndroidManifest.xml file. You can also implement these two agent classes in a Bundle. To do this, you must modify the value of the corresponding meta-data tag in the configuration:

     <application
          android:name="com.alipay.mobile.quinox.LauncherApplication" >

         <!-- Callback configuration for the Application -->
         <meta-data
            android:name="agent.application"
            android:value="com.mpaas.demo.launcher.framework.MockLauncherApplicationAgent"/>

        <!-- Callback configuration for the Activity -->
        <meta-data
            android:name="agent.activity"
            android:value="com.mpaas.demo.launcher.framework.MockLauncherActivityAgent"/>
        <!-- Layout configuration for the startup page -->
        <meta-data
            android:name="agent.activity.layout"
            android:value="layout_splash"/>

     </application>

Agent classes

The agent.application property configures the ApplicationAgent, which is the agent for the startup process. The following code shows an example:

  public class MockLauncherApplicationAgent extends LauncherApplicationAgent {
      @Override
      protected void preInit() {
          super.preInit();
          // Before framework initialization
      }

      @Override
      protected void postInit() {
          super.postInit();
          // After framework initialization
      }
  }

In the implementation class of LauncherApplicationAgent, the client application can perform Application-level initialization. The preInit() callback occurs before the framework initializes. Do not call any framework APIs, such as MicroApplicationContext, in this callback. The postInit() callback occurs after the framework initializes. You can use framework APIs in this callback.

The agent.activity property configures the agent for the startup Activity. The following code shows an example:

public class MockLauncherActivityAgent extends LauncherActivityAgent {

        @Override
        public void preInit(Activity activity) {
                super.preInit(activity);
                // Before the Launcher Activity starts
        }

        @Override
        public void postInit(final Activity activity) {
            super.postInit(activity);
                // After the Launcher Activity starts
                // Logic to navigate to the application's home page
                startActivity(activity,YOUR_ACTIVITY);
        }
}

Similar to LauncherApplicationAgent, the two callbacks for LauncherActivityAgent occur before and after framework initialization, and their usage is similar.

Modify the startup page layout

The layout file for the startup page is also configured in the Portal's AndroidManifest.xml file. The following code shows an example:

<application
android:name="com.alipay.mobile.quinox.LauncherApplication" >
<!-- Layout configuration for the startup page -->
<meta-data
android:name="agent.activity.layout"
android:value="layout_splash"/>

</application>

You can change the value to the name of your custom layout file.

Note

Place the layout file and its referenced resources in the Portal project.