All Products
Search
Document Center

Quick start

Last Updated: May 25, 2021

You can integrate Datacenter to your project through Native AAR, mPaaS Inside, or Portal & Bundle mode. Multiple storage methods such as database storage, key-value pair storage, and file storage can be implemented to meet different business requirements.

Prerequisites

  • If you want to connect the component to the mPaaS based on the native AAR mode, you need to first complete the prerequisites and the subsequent steps. For more information, see Add mPaaS to your project
  • If you want to connect the component to the mPaaS based on the mPaaS Inside mode, you need to first complete the mPaaS Inside access procedure.
  • If you want to connect the component to the mPaaS based on components, you need to first complete the Component-based access procedure.

Add the SDK

Native AAR mode

You can use the component management (AAR) function to install the Storage component in your project. For more information, see AAR component management.

mPaaS Inside mode

In your project, install the Storage component on the Component Management page.
For more information, see Manage component dependencies.

Component-based mode

In your Portal and Bundle projects, install the Storage component on the Component Management page.
For more information, see Manage component dependencies.

mPaaS initialization

In the native AAR or mPaaS Inside mode, you must initialize the mPaaS.
Add the following code to the Application class:

 
  1. public class MyApplication extends Application {
  2. @Override
  3. protected void attachBaseContext(Context base) {
  4. super.attachBaseContext(base);
  5. // Initialize callback settings for mPaaS.
  6. QuinoxlessFramework.setup(this, new IInitCallback() {
  7. @Override
  8. public void onPostInit() {
  9. // This callback indicates that mPaaS has been initialized, and mPaaS-related calls can be made in this callback.
  10. }
  11. });
  12. }
  13. @Override
  14. public void onCreate() {
  15. super.onCreate();
  16. // Initialize mPaaS.
  17. QuinoxlessFramework.init();
  18. }
  19. }

Using storage

If you need to use the database to store related content, see Database storage.

If you need to use the key-value pair to store related content, see Key-value pair storage.

If you need to use the file to store related content, see File storage.

Sample code

See Sample code to obtain sample code.