Mobile PaaS (mPaaS) provides two integration methods: the native AAR method and the component-based method (Portal & Bundle). This topic describes both types and provides recommendations to help you choose the right one for your project.
native AAR method
The native AAR integration method uses the standard Android AAR packaging solution. This approach aligns with the common technology stack for Android developers. Developers do not need to learn about mPaaS-specific packaging. You can integrate mPaaS into your project using the mPaaS Android Studio plugin or directly through Maven POM and BOM files. This type lowers the barrier to entry and makes it easier to use mPaaS. It is ideal for developers who want to quickly use mPaaS features and do not need the component-based (Portal & Bundle) integration method.
The native AAR integration method is supported in mPaaS 10.1.68 and later.
Component-based method (Portal & Bundle)
The component-based method is a framework based on the Open Service Gateway Initiative (OSGi). It divides an app into one or more independent business Bundle projects and a single Portal project. mPaaS manages the lifecycle and dependencies of each Bundle project. The Portal project then merges all Bundle projects into a single, runnable .apk package. This type is suitable for large-scale projects that require parallel development by multiple teams. To use the component-based method, you must import the mPaaS Gradle packaging tool. This type requires specific versions of Gradle and the com.android.tools.build:gradle plugin.
How to choose a integration method
Use the native AAR method if you want to integrate mPaaS as easily as any other SDK. Use the component-based method if you are using mPaaS to refactor your project for large-scale parallel development.
Comparison of integration methods
Native AAR connection | Component-based connection | |
Source | Official Google method. | From Alipay. |
Packaging speed | Slower of the two. Same as a standard native build. | Fast. Packaging time is distributed. |
Project structure | App module and library modules. | Portal (an app shell) and Bundles (business components). |
Gradle version dependency | Can be upgraded to the latest official version. | 4.4 or 6.3. Do not upgrade. |
AGP1 toolchain dependency | Can be upgraded to the latest official version. | AGP 3.0.1 or 3.5.x. Do not upgrade. |
Android Support Library | Supported. | Must use the version provided by mPaaS (23). Do not upgrade. |
AndroidX | Full support2 | Not supported |
databinding | Full support | v1 |
kotlin | Full support | Avoid use. |
AGP stands for Android Gradle Plugin, which is used for packaging Android applications.
Supported by setting
android.enableJetifier=trueandandroid.useAndroidX=true.