hi_health 0.1.3

Flutter Android

Flutter plugin for Huawei HiHealth integration. For fetching steps, distance and dates.

HiHealth #

[Disclaimer] This is not an official huawei hihealth plugins. #

  • You must head to https://developer.huawei.com/consumer/en/ and create your account and app account.
  • This plugin is a wrapper for their .jar and android implementation.
  • Head to this link if you prefer to implement it yourself.
  • HiHealth is only available on Android. For iOS, use Apple Health.

Prerequisite #

  1. Register yourself or your company at https://developer.huawei.com/.
  2. Register your app at Console > Smart Living > HiHealth Kit
  3. You may need to tweak gradle depends if you are using your own keystore. Keystore is ignored.

Getting Started #

Running example

  1. Create a copy of example.properties from example.properties.bak
  2. Replace your data in example.properties
  3. Run the project.

Using in your own project

  1. Add this into your AndroidManifest.xml
<meta-data
            android:name="com.huawei.hms.client.appid"
            android:value="${huaweiID}"/>
  1. Add to pubspec.yaml
huawei_health:
    git:
      url: git://github.com/zaralockheart/huawei_health
  1. Import
import 'package:hi_health/hi_health.dart';

Usage. #

To get the Steps data:

Future getSteps() async {
    final start = DateTime.now().subtract(Duration(days: 5));
    final end = DateTime.now();
    final steps = await HiHealth.getSteps(start, end);
}

To get the distance data:

Future getDistances() async {
    final start = DateTime.now().subtract(Duration(days: 5));
    final end = DateTime.now();
    final distances = await HiHealth.getDistance(start, end);
}
8
likes
80
pub points
50%
popularity

Flutter plugin for Huawei HiHealth integration. For fetching steps, distance and dates.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

zaralockheart@gmail.com

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on hi_health