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.

There are two types of APIs in Awareness Kit — Capture API and Barrier API. The Capture API allows the app to request the current user status and the Barrier API allows the app to set a combination of contextual conditions. In this article, we are explaining about Location Awareness, Headset Awareness, Ambient Light Awareness and Bluetooth Car Stereo Awareness.

Steps for Developing Capture Capabilities

  1. Obtain the Capture Client object of HUAWEI Awareness Kit.
  2. Call the respective query capability API through the Capture Client object to obtain the user’s context.
  3. Enable your app to listen for the result returned by HUAWEI Awareness Kit for further processing.

Steps for developing barrier capabilities

  1. Define the barrier.
  2. Define PendingIntent that will be triggered upon a barrier status change, for example, to send a broadcast, and create a broadcast receiver to receive the broadcast.
  3. Define the label for the barrier and add the barrier.
  4. Define the broadcast receiver to listen for the barrier event for further processing.

In this article, we are explaining about Location Awareness, Headset Awareness, Ambient Light Awareness, and Bluetooth Car Stereo Awareness.

#java #mobile #integration #android #kotlin #application

A Journey Through HMS Awareness - DZone Web Dev
1.30 GEEK