Code Monkey home page Code Monkey logo

alsa-nan / hms-awareness-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hms-core/hms-awareness-demo

0.0 0.0 0.0 710 KB

HUAWEI Awareness Kit provides your app with the ability to obtain contextual information including users' current time, location, behavior, audio device status, ambient light, weather, and nearby beacons. Your app can gain insight into a user's current situation more efficiently, making it possible to deliver a smarter, more considerate user experience.

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

License: Apache License 2.0

Java 100.00%

hms-awareness-demo's Introduction

HMS AwarenessKit Demo

Contents

Overview

The sample code shows how to use the Capture API and Barrier API of HUAWEI Awareness Kit for quick integration.

Introduction of HMS Awareness Kit.

Getting Started

This sample uses the Gradle build system.

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

Check whether the Android studio development environment is ready. Open the sample code project directory with file "build.gradle" in Android Studio.

To compile and run sample code , you should create an app in AppGallery Connect, change the sample package name to your app package name, and place the agconnect-services.json file and signing certificate under the app directory. For details, please refer to Preparations.

Running Environment

Android Studio and JDK 1.8 are used for coding.

Run the app generated by the sample code on the device which have installed Huawei Mobile Service(HMS).

Sample Code

The HUAWEI Awareness Kit sample code includes Capture and Barrier API sample code.

Capture APIs can be called to obtain the time, headset, location, activity, ambient light, weather, bluetooth car stereo, and beacon status. Capture APIs allow your app to request the status of a user. For example, the getHeadsetStatus() API can be used to obtain connection status of the headset.

For details about Capture APIs, please visit the References of the Capture APIs.

Barrier APIs can be called to implement awareness of the time, headset, location, activity, ambient light, Bluetooth car stereo, and beacon status. Barrier APIs allow your app to set a series of awareness states. When a user enters a set state, Awareness Kit triggers the corresponding callback to notify the app. For example, the LocationBarrier.enter() API can be used to create a geo-fence.When the user enters the area specified by the geo-fence, Awareness Kit triggers the corresponding callback to notify the app.

For details about Barrier APIs, please visit the References of the Barrier APIs.

Other Awareness Kit API References.

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

HUAWEI Awareness Kit sample is licensed under the Apache License, version 2.0.

hms-awareness-demo's People

Contributors

bun-cheung avatar hms-awarenesskit avatar hms-mlkit avatar mike-mei avatar tiantian0303 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.