All Products
Search
Document Center

Quick start guide

Last Updated: Jun 23, 2021

Mobile Analysis Service (MAS for short) depends on the client SDK to implement event tracking, collect user behavior, App performance and other related data to generate logs, and report the logs to the server. The server extracts valid data from the tracking logs uploaded by the client based on the negotiated tracking log format to monitor and analyze client metrics.

This topic briefly describes how to fast integrate MAS to the Android client. You can access MAS through Native AAR, mPaaS Inside, or Portal & Bundle.

The complete access process mainly includes the following 5 steps:

  1. Add SDK
  2. Initialize mPaaS
  3. Set project
  4. Add logs
  5. View local logs
  6. Upload logs

Prerequisites

Add SDK

Native AAR mode

Follow the instructions in AAR component management to install the LOGGING component in the project through Component management (AAR).

mPaaS Inside mode

Install the LOGGING component in the project through Component management.

Fore more information, see Manage component dependencies > Add/delete component dependencies.

Componentized access mode

Install the LOGGING component in the Portal and Bundle projects through Component management.

Fore more information, see Manage component dependencies > Add/delete component dependencies.

Initialize mPaaS

Native AAR/mPaaS Inside mode

If you access MAS through Native AAR or mPaaS Inside, you must initialize mPaaS.

Add the following codes in the object Application:

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

Componentized access mode

If you access MAS in componentized access mode (Portal & Bundle), you dont’t have to implement mPaaS initialization.

Set project

Log uploading

Network access is required to upload logs. You need to declare the following permissions in the AndroidManifest file.

 
  1. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  2. <uses-permission android:name="android.permission.INTERNET" />

Log diagnosis

To use the log diagnosis function, you need to declare the following permission in the AndroidManifest file, and apply for the permission when the App runs on the Android 6.0+ devices.

 
  1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

The diagnostic log will be saved to the SD card of the device. With above permission, you cannot obtain the diagnostic log.

Channel number setting

To distinguish the apk data of different channels in the mPaaS console, you can set channel number for the apk.

In the App project, create the channel.config file under the directory assets and modify the value of channel_id.

 
  1. # Identify the current release channel
  2. channel_id=alipay

Add logs

You can add the following logs after integrating the SDK:

View local logs

View local logs to learn the local log information.

Upload logs

Synchronize the local log files on a client to the log server. For specific operations, see Upload logs.