Giter Club home page Giter Club logo

hms-core / hms-health-demo-kotlin Goto Github PK

View Code? Open in Web Editor NEW
26.0 14.0 7.0 1.2 MB

HMS Health demo code provides demo programs for your reference or usage. Developers can access the Huawei Health Platform and obtain sports & health data by integrating HUAWEI Health.

Home Page: https://developer.huawei.com/consumer/en/hms/huawei-healthkit?ha_source=hms1

License: Apache License 2.0

Kotlin 100.00%
sports fitness health health-data huawei hms

hms-health-demo-kotlin's Introduction

HMS Health Kit Demo for kotlin

English | δΈ­ζ–‡

Table of Contents

Introduction

HUAWEI Health is an open service for sports & health capabilities provided by Huawei. Developers can access the Huawei Health Platform and obtain sports & health data by integrating HUAWEI Health.
Health demo code encapsulates APIs of the HUAWEI Health Kit. It provides demo programs for your reference or usage.

The following describes the functions of Health Kit:

  1. Login and Authorization
    This function applies to login the account and enable the authorization.
    Android APIs code location: \app\src\main\java\com\huawei\demo\health\auth\HealthKitAuthActivity.kt

  2. Cancel Scope
    This function applies to cancel account authorization.
    Android APIs code location: \app\src\main\java\com\huawei\demo\health\HealthKitMainActivity.kt

  3. Operate health and sport data
    The function has ability to add/delete/update/query the health and sport data.
    Code location: \app\src\main\java\com\huawei\demo\health\HealthKitDataControllerActivity.kt

  4. Auto-record the step count
    This function can enable and disable the automatically record method for the step count.
    Code location: \app\src\main\java\com\huawei\demo\health\HealthKitAutoRecorderControllerActivity.kt

  5. Operate Activity Record
    This function can create and manage a single sport or activity.
    Code location: \app\src\main\java\com\huawei\demo\health\HealthKitActivityRecordControllerActivity.kt

  6. Operate DataType and Records
    This function can add/read DataType and cancel All Records.
    Code location: \app\src\main\java\com\huawei\demo\health\HealthKitSettingControllerActivity.kt

  7. Operate Health Record
    This function can add/read/update a health record. Currently, the data types of the tachycardia bradycardia are supported.
    Code location: \app\src\main\java\com\huawei\demo\health\HealthKitHealthRecordControllerActivity.kt

Getting Started

Before using Health demo code, check whether the IDE environment has been installed.

  1. Decompress the demo code package.
  2. Copy the Health package into the IDE directory and import it into the IDE Tool.
  3. You should also generate a signing certificate fingerprint and add the certificate file to the project, and add configuration to build.gradle. See (https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/signing-fingerprint-0000001059050363-V5)
  4. Press Sync Project with Gradle Files to ensure the development environment builds completed.

To use functions provided by packages in examples, you need to set parameters as following:

  1. HuaweiAccount: Health need verify the user's permission to operate user's health data
  2. HMS SDK maven Address:
  3. Compile dependencies: Add compile dependencies in model's build.gradle : implementation 'com.huawei.hms:health:{version}'
  4. AppId info: In the application AndroidManifest.xml, add the appId information generated by the Developer Alliance when creating the application.

Supported Environments

  • Android Studio 3.6.1 or later.
  • Java SDK 1.8 or later.
  • Mobile Android Version 7.0-13 (API level 24-33) or HarmonyOS. HMS Core (APK) 4.0.2.300 or later has been installed on the phone. To read data from the Health app, HMS Core (APK) 5.0.4.300 or later should be installed. HUAWEI Health app of version 11.0.0.512 or later has been installed.

Result

Question or Issues

If you want to evaluate more about HMS Core, r/HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.

If you have questions about how to use HMS samples, try the following options:

  • Stack Overflow is the best place for any programming questions. Be sure to tag your question with huawei-mobile-services.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.

If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.

License

Health kit demo is licensed under the Apache License, version 2.0.

hms-health-demo-kotlin's People

Contributors

healthkit-hms avatar mike-mei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hms-health-demo-kotlin's Issues

Unable to Authorise Huawei HealthKit

I was instructed to:

Manually install the latest Huawei Health App, and navigate to Me > Privacy manage > Link Huawei Health Kit.

However, I don't have this option on the latest Huawei Health App.
image

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.