The sample code provides a demo project that demonstrates how to call open APIs of Analytics Kit. Guided by the demo, you will learn how to:
- Efficiently integrate Analytics Kit.
- Correctly use APIs of Analytics Kit.
You can use the sample code only after completing the following operations:
- Sign in to AppGallery Connect, click My projects, and click the app for which you want to integrate the Analytics SDK. Go to Project settings, download the agconnect-services.json file, and set the value of the custom variable agConnectConfig to the content of the agconnect-services.json file. Copy the agConnectConfig code snippet to the app.ux file of your project, and initialize the Analytics SDK by referring to the README file in the demo project.
Start the demo project.
- Connect your phone to your computer and ensure that your phone is in debug mode.
- Click the real-time compilation button or press shortcut keys Ctrl+Shift+R.
- Upon successful startup, the quiz demo is displayed in the real-time preview window on the right of the phone and IDE.