Giter Site home page Giter Site logo

jisoo134 / hms-analytics-demo-harmonyos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hms-core/hms-analytics-demo-harmonyos

0.0 0.0 0.0 101 KB

HmsAnalyticsKitDemo is a app that applying HUAWEI Hianalytics SDK used for showing how to collect user engagement and user preference.

License: Apache License 2.0

Java 100.00%

hms-analytics-demo-harmonyos's Introduction

HUAWEI AnalyticsKit Demo for HarmonyOS

English | δΈ­ζ–‡

Table of Contents

Introduction

AnalyticsKitDemo provides an example of integrating HUAWEI Analytics Kit with an Hap. It illustrates how to collect predefined events and custom events to improve user engagement and user preference. Read more about Analytics Kit.

Getting Started

For more development guidance, please refer to the links below:

Development Guide.

API References.

In this example, we demonstrate how to use the analytics SDK for HarmonyOS by using the Gradle build system.

First download AnalyticsKitDemo by cloning this repository or downloading an archived snapshot.

In HUAWEI DevEco Studio, click Open Project, and select AnalyticsKitDemo.

You can use the gradlew build command to build the project directly.

You should create an Hap in AppGallery Connect, and obtain the agconnect-services.json file and add it to the project. You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to the build.gradle file. More to Development Process.

Installation

Use HUAWEI DevEco Studio to open the decompressed project.

Configuration

  1. Create an Hap in AppGallery Connect and obtain the project configuration file agconnect-services.json. In HUAWEI DevEco Studio, switch to the Project view and move the agconnect-services.json file to the root directory of the entry.
  2. Change the value of bundleName in the config.json file of the entry to the name of the Hap package applied for in the preceding step.

Environment requirements

Hardware requirements:

  1. A computer (desktop or laptop)
  2. A Huawei phone, which is used to debug the developed Hap

Software requirements:

  1. HUAWEI Analytics Kit 6.2.0
  2. HarmonyOS SDK applicable to devices using HarmonyOS 2.0.0 (API level 4) and later versions
  3. HUAWEI DevEco Studio
  4. JDK version: 1.8 or later

Result

After running the Hap you should see a screen like this:

Click True or False to answer the question; Click Next to show the next question; Click Post Score, log the score user got. All the information will be uploaded to the Analytics Kit Console, and you can see these information in real time using Debug View.

Click button Settings:

When you click Settings, you will be asked for your favorite sport. Your choice will be logged by Analytics Kit as a user attribute.

License

AnalyticsKitDemo is licensed under the Apache License, version 2.0.

hms-analytics-demo-harmonyos's People

Contributors

fenger-hash avatar mike-mei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.