All Products
Search
Document Center

Mobile Platform as a Service:Quick start

Last Updated:Feb 12, 2026

This topic describes how to integrate the mPaaS Hotpatch feature into your Android app.

Hotpatch supports two integration methods: native AAR and component-based.

  1. Add the SDK

  2. Initialize hotpatch (Required for the native AAR integration method only)

  3. Generate a hotpatch

  4. Publish the hotpatch

  5. Trigger the hotpatch

Prerequisites

Add the SDK

Native AAR integration method

Use Component Management (AAR) to install the Hotpatch (HOTFIX) component in your project. For more information, see Manage component dependencies.

Component-based integration method

In the Portal and Bundle projects, use Component Management to install the Hotpatch (HOTFIX) component. For more information, see Manage component dependencies.

Initialize hotpatch

Native AAR integration

To use the hotpatch feature, you must complete the following steps.

  1. Your Application object must inherit from QuinoxlessApplicationLike. Prevent this class from being obfuscated. The following example uses `MyApplication`.

     @Keep
     public class MyApplication extends QuinoxlessApplicationLike implements Application.ActivityLifecycleCallbacks {
      private static final String TAG = "MyApplication";
      @Override
      protected void attachBaseContext(Context base) {
          super.attachBaseContext(base);
          Log.i(TAG, "attachBaseContext");
      }
      @Override
      public void onCreate() {
          super.onCreate();
          Log.i(TAG, "onCreate");
          registerActivityLifecycleCallbacks(this);
      }
      @Override
      public void onMPaaSFrameworkInitFinished() {
          MPHotpatch.init(); 
          LoggerFactory.getTraceLogger().info(TAG, getProcessName());
      }
      @Override
      public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
          Log.i(TAG, "onActivityCreated");
      }
      @Override
      public void onActivityStarted(Activity activity) {
      }
      @Override
      public void onActivityResumed(Activity activity) {
      }
      @Override
      public void onActivityPaused(Activity activity) {
      }
      @Override
      public void onActivityStopped(Activity activity) {
      }
      @Override
      public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
      }
      @Override
      public void onActivityDestroyed(Activity activity) {
      }
     }
  2. In the AndroidManifest.xml file, set the Application object to the one provided by mPaaS. Add the MyApplication class that you created to the meta-data tag that has the key mpaas.quinoxless.extern.application. The following code shows an example:

     <application
         android:name="com.alipay.mobile.framework.quinoxless.QuinoxlessApplication" >
         <meta-data
              android:name="mpaas.quinoxless.extern.application"
              android:value="com.mpaas.demo.MyApplication" 
              />
     </application>

    com.mpaas.demo.MyApplication is your custom application agent class that inherits from QuinoxlessApplicationLike.

Component-based integration

No changes are needed for this integration method because the required content is already integrated.

Generate a hotpatch

For more information, see Generate a hotpatch package.

Publish the hotpatch

For more information, see Release a hotpatch package.

Trigger the hotpatch

This section uses the Hotpatch example in the code sample to describe the hotpatch procedure.

In this code sample, the content to be fixed is the text in a Toast message.

  • Before you apply the fix, click the Impersonate the click event to be hotpatched button. A Toast message appears.

  • To apply the fix, click the Trigger hotpatch deployment detection button to trigger the hotpatch download. After the download is complete, restart the demo application.

  • After the fix is applied, click the Impersonate the click event to be hotpatched button. A Toast message appears with the text 'The current click event has been hotpatched'.

Troubleshooting

  • Do not import `apache-httpclient` or `apache-commons` through unofficial methods. For more information, see the official documentation on the Android developer platform.

  • Do not import SDKs related to the NFC system through unofficial methods.

  • Make sure that you do not inherit from any `Application`-related classes. Use `ApplicationLike` instead.

To view hotpatch logs, filter by the tag `DynamicRelease`.

  • Download phase: Filter by `RPCException`. If an `RPCException` occurs, the download has failed.

    Note

    If an RPC-related exception occurs, troubleshoot it based on the error code. For more information, see RPC calls.

  • Patch merging phase: Filter by immediately=true. A log entry that matches this filter indicates that the patch was successfully merged. After the patch is merged, you must restart the app for the patch to take effect.