Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Documents from this version have been archived, and will not continue to be maintained. Please use the latest version.
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.
Converged: Multi-dimensional and evolvable awareness capabilities can be called in a unified manner.
Accurate: The synergy of hardware and software makes data acquisition more accurate and efficient.
Fast: On-chip processing of local service requests and nearby access of cloud services promise a faster service response.
Economical: Sharing awareness capability avoids separate interactions between apps and the device, reducing system resource consumption.
* Collaborating with the EMUI (or Magic UI) and Kirin chip, HUAWEI Awareness Kit can even achieve better performance with lower power consumption.
Capture API
The Capture API allows your app to request the current user status, such as time, location, behavior, and whether a headset is connected. For example, after your app runs, it can request the user's time and location in order to recommend entertainment activities available nearby at weekends to the user.
Barrier API
The Barrier API allows your app to set a combination of contextual conditions. When the preset contextual conditions are met, your app will receive a notification. You can even accommodate your app with different combinations of contextual conditions to support different use cases. For example, your app can recommend nearby services if the user has stayed in a specified business zone for the preset period of time.
The time awareness capability can obtain holiday information of most countries/regions and sunrise and sunset time of all cities around the world. Holiday information is updated periodically to ensure data timeliness and accuracy.
Capture
Obtains the current local time or time of a specified location, such as working day, weekend, holiday, morning, afternoon, evening, or late night.
You can obtain the local time of a device based on its location or IP address. If the device accesses the network through a VPN or proxy server, the time obtained by IP address may be incorrect. Note that the location required for time query only needs to be accurate to two decimal places. Before obtaining the location of a device, you must obtain explicit authorization from the user.
You can enter a country/region code complying with ISO 3166-1 to obtain the time of the specified country/region.
Barrier
Sets a timer or a barrier based on the target time. For example, one hour before and after the sunrise can be set as a sunrise barrier.
Capture
Obtains the latitude and longitude of the current location.
Barrier
Sets a location barrier based on the target location, radius (not smaller than 200 m), and stay duration. For example, if you set a circular region with a 500 m radius in the target location as a barrier, a notification will be triggered if the user has stayed in the area for the specified period of time.
Note that before calling the location awareness capability, you must obtain explicit authorization from the user. If the GPS function is not enabled or the GPS signal is weak, the location may not be obtained and the geo-fence may not be triggered.
Capture
Obtains user behavior, such as walking, running, cycling, driving, or staying still.
Barrier
Detects the behavior change, such as going from staying still to running.
Note that before calling the behavior awareness capability, you must obtain explicit authorization from the user.
A beacon is a small device that periodically sends signals to nearby devices. Devices within the beacon signal range can receive signals from the beacon and obtain information from the cloud according to the signals.
Currently, HUAWEI Awareness Kit supports beacon devices whose broadcast format is iBeacon or Eddystone-UID. The Beacon ID field in a broadcast packet is user-defined. Beacons with the same beacon ID are considered as the same beacon by HUAWEI Awareness Kit. You need to inform users of this.
For details about how to use and manage beacon devices, please refer to Beacon Management of HUAWEI Nearby Service.
Capture
Indicates whether the device has approached, connected to, or disconnected from a registered beacon.
Barrier
Sets a beacon barrier based on the beacon status. For example, if a barrier for discovering a beacon is set, a barrier notification will be triggered when HUAWEI Awareness Kit discovers the beacon.
Obtains the status of audio devices that can be connected to phones. Currently, the following audio devices are supported: 3.5 mm headsets, Type-C headsets, Bluetooth headsets (Bluetooth devices identified as "headsets", which may be actual Bluetooth headsets or just Bluetooth stereos), and Bluetooth car stereos.
Capture
Obtains the status of an audio device (connected or disconnected).
Barrier
Detects the audio device status change, for example, from plugged in to unplugged.
Note: On non-Huawei phones, HMS Core (APK) may be unable to listen for broadcasts from the Android operating system due to certain limitations. For example, if HMS Core (APK) does not listen for the broadcast indicating a Bluetooth device connection, the Bluetooth device-related barrier already registered cannot be triggered as expected.
Capture
Obtains the illuminance of the environment where the device is located. The unit is lux. The illuminance is the intensity received by the light sensor of the device. When the light sensor is blocked or illuminated by strong light, the obtained illuminance changes accordingly.
Barrier
Sets the ambient light barrier. For example, you can set the system to prompt users to enable the flashlight function when the illuminance is less than 100 lux.
Note: On some phones, ambient light awareness is unavailable when power saving mode is activated. If this will affect the running of your app, you should remind users to change their settings so that power saving does not affect HUAWEI HMS Core.
Capture
Queries the weather information of the device location or a specified location. Weather of the current day (24 hours) and the next seven days (including the current day) can be queried. The weather information includes the atmospheric temperature, somatosensory temperature, humidity, wind force, wind direction, ultraviolet light intensity, air quality index (AQI), and living index. The AQI and living index are about only the data of the Chinese mainland.
You can obtain the weather information of a device based on its location or IP address. If the device accesses the network through a VPN or proxy server, the weather obtained by IP address may be incorrect.
You can also obtain weather information by address. An address has five attributes: country/region, province/state, city, district, and county/town. You can enter all or some of the attributes. To obtain more accurate weather information, you are advised to enter all of the five attributes.
Barrier
The weather awareness does not support the barrier function.
When developing apps using the Huawei Mobile Services (HMS) SDK, please comply with the HUAWEI Developer Service Agreement, Agreement on Use of Huawei APIs, and AppGallery Connect Data Processing Addendum. HUAWEI Awareness Kit does not store any personal data or disclose personal data to any third parties. If you need to obtain a user's sensitive personal data (such as location information), ensure that you have obtained express consent from the user in advance.
For details please refer to Regions Supported by HUAWEI Awareness Kit.