Getting Started
Unified Storage supports two connection types: native Android Archive (AAR) connection and component-based connection. It provides database, key-value, and file storage to meet various business needs.
Prerequisites
If you are using the native AAR integration method, you must first complete the steps in Add mPaaS to your project.
If you are using the component-based integration method, you must first complete the Component-based integration flow.
Add the SDK
Native AAR connection
Use Component Management (AAR) to install the Storage component in your project. For more information, see AAR Component Management.
Component-based approach
In Portal and Bundle projects, use Component Management to install the Storage component. For more information, see Manage component dependencies.
Initialize mPaaS
If you added the SDK using the native AAR connection, initialize mPaaS by adding the following code to your Application class:
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Initialize mPaaS
MP.init(this);
}
}For more information, see mPaaS Initialization.
Use storage
To use a database to store content, see Database storage.
To store content using key-value pairs, see Key-value Pair Storage.
To use file storage, see File Storage.
Code sample
Click here to obtain the sample code.