huawei_awareness 1.0.7+303
huawei_awareness: ^1.0.7+303 copied to clipboard

Flutter Android

HUAWEI Awareness Kit provides your app with the ability to obtain contextual information including users' time, location, behavior, ambient light, weather, and nearby beacons.

Huawei Awareness Kit Flutter Plugin #


Contents #


1. Introduction #

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.

  • Capture Client

    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 Client

    The Barrier API allows your app to set a barrier for specific contextual conditions. When the conditions are met, your app will receive a notification. For example, a notification is triggered when an audio device connects to a mobile phone for an audio device status barrier about connection or illuminance is less than 100 lux for an ambient light barrier whose trigger condition is set for illuminance that is less than 100 lux. You can also combine different types of barriers for your app to support different use cases. For example, your app can recommend nearby services if the user has stayed in a specified business zone (geofence) for the preset period of time (time barrier).

This plugin enables communication between HUAWEI Awareness Kit SDK and Flutter platform. It exposes all functionality provided by HUAWEI Awareness Kit SDK.


2. Installation Guide #

  • Before you get started, you must register as a HUAWEI developer and complete identity verification on the HUAWEI Developer website. For details, please refer to Register a HUAWEI ID.

  • Create an app in your project is required in AppGallery Connect in order to communicate with Huawei services. To create an app, perform the following steps:

Step 1. Sign in to AppGallery Connect and select My projects.

Step 2. Click your project from the project list.

Step 3. Go to Project Setting > General information, and click Add app. If an app exists in the project, and you need to add a new one, expand the app selection area on the top of the page and click Add app.

Step 4. On the Add app page, enter app information, and click OK.

  • A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to access an HMS Core service through the HMS Core SDK. Before using HMS Core (APK), you must locally generate a signing certificate fingerprint and configure it in AppGallery Connect. Ensure that the JDK has been installed on your computer.

Configuring the Signing Certificate Fingerprint #

Step 1: Go to Project Setting > General information. In the App information field, click the icon next to SHA-256 certificate fingerprint, and enter the obtained SHA256 certificate fingerprint.

Step 2: After completing the configuration, click check mark.

Integrating Flutter Awareness Plugin #

Step 1: Sign in to AppGallery Connect and select My projects.

Step 2: Find your app project, and click the desired app name.

Step 3: Go to Project Setting > General information. In the App information section, click agconnect-services.json to download the configuration file.

Step 4: Create a Flutter project if you do not have one.

Step 5: Copy the agconnect-service.json file to the android/app directory of your Flutter project.

Step 6: Copy the signature file that generated in Generating a Signing Certificate section, to the android/app directory of your Flutter project.

Step 7: Check whether the agconnect-services.json file and signature file are successfully added to the android/app directory of the Flutter project.

Step 8: Open the build.gradle file in the android directory of your Flutter project.

  • Go to buildscript then configure the Maven repository address and agconnect plugin for the HMS SDK.

        buildscript {
            repositories {
                google()
                jcenter()
                maven { url 'https://developer.huawei.com/repo/' }
            }
    
            dependencies {
                /*
                 * <Other dependencies>
                 */
                classpath 'com.huawei.agconnect:agcp:1.4.2.301'
            }
        }
    
  • Go to allprojects then configure the Maven repository address for the HMS SDK.

        allprojects {
            repositories {
                google()
                jcenter()
                maven { url 'https://developer.huawei.com/repo/' }
            }
        }
    

Step 9: Open the build.gradle file in the android/app directory.

  • Add apply plugin: 'com.huawei.agconnect' line after the apply entries.

        apply plugin: 'com.android.application'
        apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
        apply plugin: 'com.huawei.agconnect'
    
  • Set your package name in defaultConfig > applicationId and set minSdkVersion to 24 or higher.

  • Package name must match with the package_name entry in agconnect-services.json file.

        defaultConfig {
                applicationId "<package_name>"
                minSdkVersion 24
                /*
                 * <Other configurations>
                 */
            }
    
  • Copy the signature file that generated in Generating a Signing Certificate to android/app directory.

  • Configure the signature in android according to the signature file information and configure Obfuscation Scripts.

        android {
            /*
             * <Other configurations>
             */
    
            signingConfigs {
                config {
                    storeFile file('<keystore_file>.jks')
                    storePassword '<keystore_password>'
                    keyAlias '<key_alias>'
                    keyPassword '<key_password>'
                }
            }
    
            buildTypes {
                debug {
                    signingConfig signingConfigs.config
                }
                release {
                    minifyEnabled true
                    shrinkResources true
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                    signingConfig signingConfigs.config
                }
            }
        }
    
  • For Obfuscation Scripts, please refer to Configuring Obfuscation Scripts.

Step 10: On your Flutter project directory find and open your pubspec.yaml file and add library to dependencies.

  • To download the package from pub.dev.

    dependencies:
      huawei_awareness: { library version }
    

    or

    If you downloaded the package from the HUAWEI Developer website, specify the library path on your local device.

    dependencies:
      huawei_awareness:
        # Replace {library path} with actual library path of Huawei Awareness Plugin for Flutter.
        path: { library path }
    
    • Replace {library path} with the actual library path of Flutter Awareness Plugin. The following are examples:
      • Relative path example: path: ../huawei_awareness
      • Absolute path example: path: D:\Projects\Libraries\huawei_awareness

Step 11: Run following command to update package info.

  [project_path]> flutter pub get

Step 12: Run following command to start the app.

  [project_path]> flutter run

3. API Reference #

AwarenessCaptureClient #

Main entry of capture APIs of HUAWEI Awareness Kit to obtain the headset status, behavior, time, location, beacon status, ambient light, weather, Bluetooth car stereo connection status, phone status, and capability support status.

Method Summary

MethodReturn TypeDescription
getBeaconStatus(List<BeaconFilter> filters)Future<BeaconResponse>Uses a variable number of the filters parameters to obtain beacon information.
getBehavior()Future<BehaviorResponse>Obtains current user behavior.
getHeadsetStatus()Future<HeadsetResponse>Obtains headset connection status.
getLocation()Future<LocationResponse>Obtains the current location (latitude and longitude) of a device.
getCurrentLocation()Future<LocationResponse>Re-obtains the latest device location information (latitude and longitude).
getTimeCategories()Future<TimeCategoriesResponse>Obtains the current time.
getTimeCategoriesByUser(double latitude, double longitude)Future<TimeCategoriesResponse>Obtains the current time of a specified location.
getTimeCategoriesByCountryCode(String countryCode)Future<TimeCategoriesResponse>Obtains the current time by country/region code.
getTimeCategoriesByIP()Future<TimeCategoriesResponse>Obtains the current time by IP address.
getTimeCategoriesForFuture(int futureTimestamp)Future<TimeCategoriesResponse>Obtains the time of a specified date by IP address.
getLightIntensity()Future<LightIntensityResponse>Obtains the illuminance.
getWeatherByDevice()Future<WeatherResponse>Obtains the weather of the current location of a device.
getWeatherByPosition(WeatherPosition weatherPosition)Future<WeatherResponse>Obtains weather information about a specified address.
getBluetoothStatus(int deviceType)Future<BluetoothResponse>Obtains the Bluetooth connection status.
getScreenStatus()Future<ScreenStatusResponse>Obtains the screen status response of a device.
getWifiStatus()Future<WiFiResponse>Obtains the Wi-Fi connection status of a device.
getApplicationStatus(String packageName)Future<ApplicationResponse>Obtains the app status of a device.
getDarkModeStatus()Future<DarkModeResponse>Obtains the dark mode status of a device.
querySupportingCapabilities()Future<CapabilityResponse>Obtains capabilities supported by Awareness Kit on the current device.
enableUpdateWindow(bool status)Future<void>Enables/disables update window.

Methods

Future<BeaconResponse> getBeaconStatus(List<BeaconFilter> filters) async

Uses a variable number of the filters parameters to obtain beacon information.

Parameters
NameTypeDescription
filtersList<BeaconFilter>Beacon filter.
Return Type
TypeDescription
Future<BeaconResponse>Response to the request for obtaining the beacon status.
Call Example
BeaconFilter filter1 = BeaconFilter.matchByBeaconContent(
  beaconNamespace: "beacon-namespace",
  beaconType: "beacon-type",
  beaconContent: Uint8List.fromList(utf8.encode("beacon-content")),
);

BeaconResponse response = await AwarenessCaptureClient.getBeaconStatus(filters: [filter1]);
Future<BehaviorResponse> getBehavior() async

Obtains current user behavior, for example, running, walking, cycling, or driving.

Return Type
TypeDescription
Future<BehaviorResponse>Response to the request for obtaining the user behavior.
Call Example
BehaviorResponse response = await AwarenessCaptureClient.getBehavior();
Future<HeadsetResponse> getHeadsetStatus() async

Obtains headset connection status.

Return Type
TypeDescription
Future<HeadsetResponse>Response to the request for obtaining the headset status.
Call Example
HeadsetResponse response = await AwarenessCaptureClient.getHeadsetStatus();
Future<LocationResponse> getLocation() async

Obtains the current location (latitude and longitude) of a device. The location information obtained by using this method is the value queried last time and cached on the device.

Return Type
TypeDescription
Future<LocationResponse>Response to the location query request.
Call Example
LocationResponse response = await AwarenessCaptureClient.getLocation();
Future<LocationResponse> getCurrentLocation() async

Re-obtains the latest device location information (latitude and longitude). When this method is used to obtain the location information, the system obtains the location information again based on the current location of the device, returns the location information, and updates the location information cached on the device.

Return Type
TypeDescription
Future<LocationResponse>Response to the location query request.
Call Example
LocationResponse response = await AwarenessCaptureClient.getCurrentLocation();
Future<TimeCategoriesResponse> getTimeCategories() async

Obtains the current time.

Return Type
TypeDescription
Future<TimeCategoriesResponse>Response to the request for obtaining the time.
Call Example
TimeCategoriesResponse response = await AwarenessCaptureClient.getTimeCategories();
Future<TimeCategoriesResponse> getTimeCategoriesByUser(double latitude, double longitude) async

Obtains the current time of a specified location.

Parameters
NameTypeDescription
latitudedoubleLatitude.
longitudedoubleLongitude.
Return Type
TypeDescription
Future<TimeCategoriesResponse>Response to the request for obtaining the time.
Call Example
TimeCategoriesResponse response = await AwarenessCaptureClient.getTimeCategoriesByUser(
    latitude: 22.4943, longitude: 113.7436);
Future<TimeCategoriesResponse> getTimeCategoriesByCountryCode(String countryCode) async

Obtains the current time by country/region code that complies with ISO 3166-1 alpha-2.

Parameters
NameTypeDescription
countryCodeStringCountry/Region code that complies with ISO 3166-1 alpha-2.
Return Type
TypeDescription
Future<TimeCategoriesResponse>Response to the request for obtaining the time.
Call Example
TimeCategoriesResponse response = await AwarenessCaptureClient.getTimeCategoriesByCountryCode(countryCode: "TR");
Future<TimeCategoriesResponse> getTimeCategoriesByIP() async

When this method is used, the time of the location corresponding to the IP address is returned. Note that the result returned through this method is less accurate than that returned through getTimeCategories, but this method does not require the precise location permission. You can select a method based on your actual requirements.

Return Type
TypeDescription
Future<TimeCategoriesResponse>Response to the request for obtaining the time.
Call Example
TimeCategoriesResponse response = await AwarenessCaptureClient.getTimeCategoriesByIP();
Future<TimeCategoriesResponse> getTimeCategoriesForFuture(int futureTimestamp) async

Obtains the time of a specified date by IP address. You can specify a future date and use this method to query its time. Note that cross-year query is not supported.

Parameters
NameTypeDescription
futureTimestampintTimestamp of the specified date. You can only set this parameter to a timestamp in the current year, because cross-year query is not supported. The timestamp is the total number of milliseconds from 00:00:00 on January 1, 1970 (GMT) to the current time.
Return Type
TypeDescription
Future<TimeCategoriesResponse>Response to the request for obtaining the time.
Call Example
TimeCategoriesResponse response = await AwarenessCaptureClient.getTimeCategoriesForFuture(
    futureTimestamp: time_stamp);
Future<LightIntensityResponse> getLightIntensity() async

Obtains the illuminance.

Return Type
TypeDescription
Future<LightIntensityResponse>Response to the request for obtaining the illuminance.
Call Example
LightIntensityResponse response = await AwarenessCaptureClient.getLightIntensity();
Future<WeatherResponse> getWeatherByDevice() async

Obtains the weather of the current location of a device.

Return Type
TypeDescription
Future<WeatherResponse>Response to the weather query request.
Call Example
WeatherResponse response = await AwarenessCaptureClient.getWeatherByDevice();
Future<WeatherResponse> getWeatherByPosition(WeatherPosition weatherPosition) async

Obtains weather information about a specified address.

An address has five attributes: country, province, city, district, and county. The city must be set and other four attributes are optional. It is recommended that all attributes be specified to constitute an accurate address so that the returned weather information will be more accurate. When entering an address, you need to specify the language type of the address. The system returns the weather information in the corresponding language based on the language type.

For example, you can enter London, or England, London, and then specify en_GB as the locale to obtain the weather of London.

Parameters
NameTypeDescription
weatherPositionWeatherPositionAddress information for weather query, including the address and language type.
Return Type
TypeDescription
Future<WeatherResponse>Response to the weather query request.
Call Example
WeatherPosition position = WeatherPosition(city: "London", locale: "en_GB", country: "United Kingdom"));
WeatherResponse response = await AwarenessCaptureClient.getWeatherByPosition(weatherPosition: position);
Future<BluetoothResponse> getBluetoothStatus(int deviceType) async

Obtains the Bluetooth connection status.

Parameters
NameTypeDescription
deviceTypeintBluetooth device type.
Return Type
TypeDescription
Future<BluetoothResponse>Response to the request for obtaining the Bluetooth car stereo status.
Call Example
BluetoothResponse response = await AwarenessCaptureClient.getBluetoothStatus(
    deviceType:BluetoothStatus.DeviceCar);
Future<ScreenStatusResponse> getScreenStatus() async

Obtains the screen status response of a device.

Return Type
TypeDescription
Future<ScreenStatusResponse>Response to the request for obtaining the screen status.
Call Example
ScreenStatusResponse response = await AwarenessCaptureClient.getScreenStatus();
Future<WiFiResponse> getWifiStatus() async

Obtains the Wi-Fi connection status of a device.

Return Type
TypeDescription
Future<WiFiResponse>Response to the request for obtaining the Wi-Fi status.
Call Example
WiFiResponse response = await AwarenessCaptureClient.getWifiStatus();
Future<ApplicationResponse> getApplicationStatus(String packageName) async

Obtains the app status of a device.

Parameters
NameTypeDescription
packageNameStringPackage name.
Return Type
TypeDescription
Future<ApplicationResponse>Response to the request for obtaining the app status corresponding to a package.
Call Example
ApplicationResponse response = await AwarenessCaptureClient.getApplicationStatus(
    packageName: "package_name");
Future<DarkModeResponse> getDarkModeStatus() async

Obtains the dark mode status of a device. The dark mode capture function is available only on devices with API level 29 or later.

Return Type
TypeDescription
Future<DarkModeResponse>Response to the request for obtaining the dark mode status.
Call Example
DarkModeResponse response = await AwarenessCaptureClient.getDarkModeStatus();
Future<CapabilityResponse> querySupportingCapabilities() async

Obtains capabilities supported by Awareness Kit on the current device.

Return Type
TypeDescription
Future<CapabilityResponse>Response to the request for obtaining supported capabilities.
Call Example
CapabilityResponse capabilities = await AwarenessCaptureClient.querySupportingCapabilities();
Future<void> enableUpdateWindow(bool status) async

Indicates whether to display a dialog box before Awareness Kit or HMS Core (APK) starts an upgrade in your app.

Parameters
NameTypeDescription
statusboolIndicates whether to enable or not.
Return Type
TypeDescription
Future<void>Future result of an execution that returns no value.
Call Example
await AwarenessCaptureClient.enableUpdateWindow(true);

AwarenessBarrierClient #

Main entry of barrier APIs of HUAWEI Awareness Kit to register and obtain barriers on device.

Method Summary

MethodReturn TypeDescription
queryBarriers(BarrierQueryRequest request)Future<BarrierQueryResponse>Queries the current status of a target barrier/s.
deleteBarrier(BarrierDeleteRequest request)Future<bool>Deletes barrier/s.
updateBarrier(AwarenessBarrier barrier, bool autoRemove)Future<bool>Adds or updates barriers.
enableUpdateWindow(bool status)Future<void>Enables/disables update window.

Stream Summary

MethodReturn TypeDescription
onBarrierStatusStreamStream<BarrierStatus>The listenable stream that emits BarrierStatus objects.

Methods

Future<BarrierQueryResponse> queryBarriers(BarrierQueryRequest request) async

Queries the current status of a target barrier/s.

Parameters
NameTypeDescription
requestBarrierQueryRequestQuery request containing query condition parameters.
Return Type
TypeDescription
Future<BarrierQueryResponse>Target barrier information, including the key value and current status.
Call Example
BarrierQueryResponse response = await AwarenessBarrierClient.queryBarriers(BarrierQueryRequest.all());
Future<bool> deleteBarrier(BarrierDeleteRequest request) async

Deletes barrier/s.

Parameters
NameTypeDescription
requestBarrierDeleteRequestDelete request containing delete condition parameters.
Return Type
TypeDescription
Future<bool>The value true indicates successful task execution.
Call Example
bool status = await AwarenessBarrierClient.deleteBarrier(BarrierDeleteRequest.all());
Future<bool> updateBarrier(AwarenessBarrier barrier, bool autoRemove) async

Adds or updates barriers.

If a barrier is added using a key that has been registered, the new barrier will replace the original one. No matter whether the new barrier is registered successfully, all callback requests of the original one will be invalid.

Parameters
NameTypeDescription
barrierAwarenessBarrierAwarenessBarrier object to be added or updated.
autoRemoveboolIndicates whether to enable the autoRemove function.
  • autoRemove as true: The autoRemove function is enabled. When the number of registered barriers exceeds the upper limit, the system automatically deletes the earliest registered barrier and registers a new one.
  • autoRemove as false: The autoRemove function is not enabled. When the number of registered barriers exceeds the upper limit, the system does not delete the earliest registered barrier. As a result, a new barrier fails to be registered.
Return Type
TypeDescription
Future<bool>The value true indicates successful task execution.
Call Example
HeadsetBarrier headsetBarrier = HeadsetBarrier.keeping(
    barrierLabel: "Headset Barrier", 
    headsetStatus: HeadsetStatus.Connected);

bool status = await AwarenessBarrierClient.updateBarriers(barrier: headsetBarrier);
Future<void>enableUpdateWindow(bool status) async

Indicates whether to display a dialog box before Awareness Kit or HMS Core (APK) starts an upgrade in your app.

Parameters
NameTypeDescription
statusboolIndicates whether to enable or not.
Return Type
TypeDescription
Future<void>Future result of an execution that returns no value.
Call Example
await AwarenessBarrierClient.enableUpdateWindow(true);

Streams

Stream<BarrierStatus> onBarrierStatusStream

The listenable stream that emits BarrierStatus objects.

Return Type
TypeDescription
Stream<BarrierStatus>The listenable stream that emits BarrierStatus objects.
Call Example
_onStatusReceived(BarrierStatus status){
    String barrierLabel = status.barrierLabel;
    log(barrierLabel, name: "Barrier Label");
}

_onStatusReceiveError(Object error) {
  print("onStatusReceiveError: " + error.toString());
}

AwarenessBarrierClient.onBarrierStatusStream.listen(_onStatusReceived, onError: _onStatusReceiveError);

AwarenessUtilsClient #

Main entry of utility APIs of HUAWEI Awareness Kit for permissions and HMSLogger handling.

Method Summary

MethodReturn TypeDescription
enableLogger()Future<void>This method enables the HMSLogger capability which is used for sending usage analytics of Awareness SDK's methods to improve the service quality.
disableLogger()Future<void>This method disables the HMSLogger capability which is used for sending usage analytics of Awareness SDK's methods to improve the service quality.
hasLocationPermission()Future<bool>This API is used to check location permission is available or not.
hasBackgroundLocationPermission()Future<bool>This API is used to check background location permission is available or not.
hasActivityRecognitionPermission()Future<bool>This API is used to check activity permission is available or not.
requestLocationPermission()Future<bool>This API is used to request location permission.
requestBackgroundLocationPermission()Future<bool>This API is used to request background location permission.
requestActivityRecognitionPermission()Future<bool>This API is used to request activity recognition permission.

Methods

Future<void> enableLogger() async

This method enables the HMSLogger capability which is used for sending usage analytics of Awareness SDK's methods to improve the service quality.

Return Type
TypeDescription
Future<void>Future result of an execution that returns no value.
Call Example
AwarenessUtilsClient.enableLogger();
Future<void> disableLogger() async

This method disables the HMSLogger capability which is used for sending usage analytics of Awareness SDK's methods to improve the service quality.

Return Type
TypeDescription
Future<void>Future result of an execution that returns no value.
Call Example
AwarenessUtilsClient.disableLogger();
Future<bool> hasLocationPermission() async

This API is used to check location permission is available or not.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool locationPermission = await AwarenessUtilsClient.hasLocationPermission();
Future<bool> hasBackgroundLocationPermission() async

This API is used to check background location permission is available or not.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool backgroundLocationPermission = await AwarenessUtilsClient.hasBackgroundLocationPermission();
Future<bool> hasActivityRecognitionPermission() async

This API is used to check activity recognition permission is available or not.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool activityRecognitionPermission = await AwarenessUtilsClient.hasActivityRecognitionPermission();
Future<bool> requestLocationPermission() async

This API is used to request location permission.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool status = await AwarenessUtilsClient.requestLocationPermission();
Future<bool> requestBackgroundLocationPermission() async

This API is used to request background location permission.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool status = await AwarenessUtilsClient.requestBackgroundLocationPermission();
Future<bool> requestActivityRecognitionPermission() async

This API is used to request activity recognition permission.

Return Type
TypeDescription
Future<bool>Returns true if permission is granted, else returns false.
Call Example
bool status = await AwarenessUtilsClient.requestActivityRecognitionPermission();

Data Types #

Data Types Summary

ClassDescription
AmbientLightBarrierIlluminance barriers, including below, above, and range barriers.
BeaconBarrierBeacon barriers, including the discover, keep, and missed barriers.
BehaviorBarrierBehavior barriers, including the beginning, ending, and keeping barriers of behaviors.
BluetoothBarrierBluetooth barriers, including the connecting, disconnecting, and keeping barriers.
CombinationBarrierObtains the integrated barriers after the specific logic operation is executed.
HeadsetBarrierHeadset barriers, including the connecting, disconnecting, and keeping barriers.
LocationBarrierLocation barriers, including the enter, exit, and stay barriers.
ScreenBarrierScreen barriers, including the status keeping, screen-on, screen-off, and screen-unlock barriers.
TimeBarrierTime barriers, including the barriers to be triggered at a time or periodically based on time.
WifiBarrierWi-Fi barriers, including the keeping, connecting, disconnecting, enabling, and disabling barriers.
BarrierRegistered barrier information.
BarrierStatusThe barrier status includes the barrier label, current status, previous status, and last status update time.
BarrierDeleteRequestDeletes a barrier based on the key value.
BarrierQueryRequestBarrier query request.
BarrierQueryResponseBarrier query response.
ApplicationResponseResponse to the request for obtaining the app status corresponding to a package.
BeaconResponseResponse to the request for obtaining the beacon status.
BehaviorResponseResponse to the request for obtaining the user behavior.
BluetoothResponseResponse to the request for obtaining the Bluetooth car stereo status.
CapabilityResponseResponse to the request for obtaining supported capabilities.
DarkModeResponseResponse to the request for obtaining the dark mode status.
HeadsetResponseResponse to the request for obtaining the headset status.
LightIntensityResponseResponse to the request for obtaining the illuminance.
LocationResponseResponse to the location query request.
ScreenStatusResponseResponse to the request for obtaining the screen status.
TimeCategoriesResponseResponse to the request for obtaining the time.
WeatherResponseResponse to the weather query request.
WifiResponseResponse to the request for obtaining the Wi-Fi status.
BeaconDataBeacon information.
DetectedBehaviorType and confidence of a detected behavior.
WeatherPositionRequest parameter class, which is used to pass address information to obtain weather information.
AqiAir quality indexes.
CityCity information including the city code, province name, time zone, and city/district name.
DailyLiveInfoInformation about a living index on a day.
DailySituationWeather conditions in the daytime or at night.
DailyWeatherWeather information of the current day and the next six to seven days.
HourlyWeatherWeather information in the current hour and the next 24 hours.
LiveInfoLiving index level for the day and the next one or two days.
SituationCurrent weather information.
WeatherSituationCurrent weather information, which consists of the current weather information (specified by Situation) and city information (specified by City).
BeaconFilterRepresents filter for beacons.
ApplicationStatusRepresents constants for Application Status.
AwarenessStatusCodesRepresents constants for Awareness Status Codes.
BluetoothStatusRepresents constants for Bluetooth Status.
CapabilityStatusRepresents constants for Capability Status.
HeadsetStatusRepresents constants for Headset Status.
ScreenStatusRepresents constants for Screen Status.
WeatherIdRepresents constants for Weather ID.
WiFiStatusRepresents constants for WiFi Status.
  • For more detailed information about classes and constants, please refer to Official Huawei Awareness Flutter Plugin Documentation.

AmbientLightBarrier

Illuminance barriers, including below, above, and range barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
minLightIntensitydoubleMinimum illuminance.
maxLightIntensitydoubleMaximum illuminance.
Constructor Summary
ConstructorDescription
AmbientLightBarrier.above(String barrierLabel, double minLightIntensity)Illuminance barrier named above.
AmbientLightBarrier.below(String barrierLabel, double maxLightIntensity)Illuminance barrier named below.
AmbientLightBarrier.range(String barrierLabel, double minLightIntensity, double maxLightIntensity)Illuminance barrier named range.
Constructors
AmbientLightBarrier.above(String barrierLabel, double minLightIntensity)

When the illuminance is within the range specified by [minLightIntensity, Float.MAX_VALUE), the barrier status is True and a barrier event is reported. When the illuminance is not within the range, the barrier status is False and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
minLightIntensitydoubleMinimum illuminance.
AmbientLightBarrier.below(String barrierLabel, double maxLightIntensity)

When the illuminance is within the range specified by [0, maxLightIntensity), the barrier status is True and a barrier event is reported. When the illuminance is not within the range, the barrier status is False and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
maxLightIntensitydoubleMaximum illuminance.
AmbientLightBarrier.range(String barrierLabel, double minLightIntensity, double maxLightIntensity)

When the illuminance is within the range specified by [minLightIntensity, maxLightIntensity), the barrier status is True and a barrier event is reported. When the illuminance is not within the range, the barrier status is False and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
minLightIntensitydoubleMinimum illuminance.
maxLightIntensitydoubleMaximum illuminance.

BeaconBarrier

Beacon barriers, including the discover, keep, and missed barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
filtersList<BeaconFilter>Beacon filters.
Constructor Summary
ConstructorDescription
BeaconBarrier.discover(String barrierLabel, List<BeaconFilter> filters)Beacon barrier named discover.
BeaconBarrier.missed(String barrierLabel, List<BeaconFilter> filters)Beacon barrier named missed.
BeaconBarrier.keep(String barrierLabel, List<BeaconFilter> filters)Beacon barrier named keep.
  • To use this barrier, you need to add the android.permission.ACCESS_FINE_LOCATION and android.permission.BLUETOOTH permissions.
Constructors
BeaconBarrier.discover(String barrierLabel, List<BeaconFilter> filters)

After this barrier is added, when a beacon of a specified type is found, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
filtersList<BeaconFilter>Beacon filters.
BeaconBarrier.missed(String barrierLabel, List<BeaconFilter> filters)

After this barrier is added, when a beacon of a specified type is lost, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
filtersList<BeaconFilter>Beacon filters.
BeaconBarrier.keep(String barrierLabel, List<BeaconFilter> filters)

After this barrier is added, when a nearby beacon of a specified type is found and not lost, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
filtersList<BeaconFilter>Beacon filters.

BehaviorBarrier

Behavior barriers, including the beginning, ending, and keeping barriers of behaviors.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
behaviorTypesList<int>One or more behavior type constants.
Constants
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.
Constructor Summary
ConstructorDescription
BehaviorBarrier.keeping(String barrierLabel, List<int> behaviorTypes)Behavior barrier named keeping.
BehaviorBarrier.beginning(String barrierLabel, List<int> behaviorTypes)Behavior barrier named beginning.
BehaviorBarrier.ending(String barrierLabel, List<int> behaviorTypes)Behavior barrier named ending.
Constructors
BehaviorBarrier.keeping(String barrierLabel, List<int> behaviorTypes)

After the barrier in a specified behavior status (excluding Unkown) is added, when a user is in the behavior status, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
behaviorTypesList<int>One or more behavior type constants.
BehaviorBarrier.beginning(String barrierLabel, List<int> behaviorTypes)

After the barrier in a specified behavior status (excluding Unkown) is added, when a user is in the behavior status, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
behaviorTypesList<int>One or more behavior type constants.
BehaviorBarrier.ending(String barrierLabel, List<int> behaviorTypes)

After the barrier in a specified behavior status (excluding Unkown) is added, when a user stops the behavior, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
behaviorTypesList<int>One or more behavior type constants.

BluetoothBarrier

Bluetooth barriers, including the connecting, disconnecting, and keeping barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
bluetoothStatusintConnection status of the Bluetooth device.
deviceTypeintBluetooth device type.
Constructor Summary
ConstructorDescription
BluetoothBarrier.keeping(String barrierLabel, int bluetoothStatus, int deviceType)Bluetooth barrier named keeping.
BluetoothBarrier.connecting(String barrierLabel, int deviceType)Bluetooth barrier named connecting.
BluetoothBarrier.disconnecting(String barrierLabel, int deviceType)Bluetooth barrier named disconnecting.
  • To use this barrier, you need to add the android.permission.BLUETOOTH permission.
Constructors
BluetoothBarrier.keeping(String barrierLabel, int bluetoothStatus, int deviceType)

After you add this barrier for a Bluetooth state such as Connected or Disconnected, if the Bluetooth keeps in this state, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
bluetoothStatusintConnection status of the Bluetooth device.
deviceTypeintBluetooth device type.
BluetoothBarrier.connecting(String barrierLabel, int deviceType)

After you add this barrier, if a Bluetooth device is connected, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
deviceTypeintBluetooth device type.
BluetoothBarrier.disconnecting(String barrierLabel, int deviceType)

After you add this barrier, if a Bluetooth device is disconnected, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
deviceTypeintBluetooth device type.

CombinationBarrier

Obtains the integrated barriers after the specific logic operation is executed.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
Constructor Summary
ConstructorDescription
CombinationBarrier.not(String barrierLabel, AwarenessBarrier barrier)Obtains the barrier after the NOT logic operation is executed.
CombinationBarrier.and(String barrierLabel, List<AwarenessBarrier> barriers)Obtains the integrated barriers after the AND logic operation is executed.
CombinationBarrier.or(String barrierLabel, List<AwarenessBarrier> barriers)Obtains the barrier after the OR logic operation is executed.
Constructors
CombinationBarrier.not(String barrierLabel, AwarenessBarrier barrier)

Obtains the barrier after the NOT logic operation is executed.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
barrierAwarenessBarrierBarrier.
CombinationBarrier.and(String barrierLabel, List<AwarenessBarrier> barriers)

Obtains the integrated barriers after the AND logic operation is executed.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
barriersList<AwarenessBarrier>Barriers.
CombinationBarrier.or(String barrierLabel, List<AwarenessBarrier> barriers)

Obtains the barrier after the OR logic operation is executed.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
barriersList<AwarenessBarrier>Barriers.

HeadsetBarrier

Headset barriers, including the connecting, disconnecting, and keeping barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
headsetStatusintHeadset status.
Constructor Summary
ConstructorDescription
HeadsetBarrier.keeping(String barrierLabel, int headsetStatus)Headset barrier named keeping.
HeadsetBarrier.connecting(String barrierLabel)Headset barrier named connecting.
HeadsetBarrier.disconnecting(String barrierLabel)Headset barrier named disconnecting.
  • To use this barrier, you need to add the android.permission.BLUETOOTH permission.
Constructors
HeadsetBarrier.keeping(String barrierLabel, int headsetStatus)

After you add this barrier with headset status Connected and Disconnected, when the headset is in specified state, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
headsetStatusintHeadset status.
HeadsetBarrier.connecting(String barrierLabel)

After this barrier is added, when a headset is connected to a device, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
HeadsetBarrier.disconnecting(String barrierLabel)

After this barrier is added, when a headset is disconnected, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.

LocationBarrier

Location barriers, including the enter, exit, and stay barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
latitudedoubleCenter latitude of an area. The unit is degree and the value range is [–90°,90°].
longitudedoubleCenter longitude of an area. The unit is degree and the value range is (–180°,180°].
radiusdoubleRadius of an area. The unit is meter.
timeOfDurationintMinimum stay time in a specified area. The unit is millisecond.
Constructor Summary
ConstructorDescription
LocationBarrier.enter(String barrierLabel, double latitude, double longitude, double radius)Barrier named enter.
LocationBarrier.stay(String barrierLabel, double latitude, double longitude, double radius, int timeOfDuration)Barrier named exit.
LocationBarrier.exit(String barrierLabel, double latitude, double longitude, double radius)Barrier named stay.
  • To use this barrier, you need to add the android.permission.ACCESS_FINE_LOCATION permission. For Android 10 or later, you also need to add the android.permission.ACCESS_BACKGROUND_LOCATION permission.
Constructors
LocationBarrier.enter(String barrierLabel, double latitude, double longitude, double radius)

After this barrier is added, when a user enters a specified area, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
latitudedoubleCenter latitude of an area. The unit is degree and the value range is [–90°,90°].
longitudedoubleCenter longitude of an area. The unit is degree and the value range is (–180°,180°].
radiusdoubleRadius of an area. The unit is meter.
LocationBarrier.stay(String barrierLabel, double latitude, double longitude, double radius, int timeOfDuration)

After this barrier is added, when a user exits from a specified area, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
latitudedoubleCenter latitude of an area. The unit is degree and the value range is [–90°,90°].
longitudedoubleCenter longitude of an area. The unit is degree and the value range is (–180°,180°].
radiusdoubleRadius of an area. The unit is meter.
timeOfDurationintMinimum stay time in a specified area. The unit is millisecond.
LocationBarrier.exit(String barrierLabel, double latitude, double longitude, double radius)

After this barrier is added, if a user is in a specified area, the barrier status is True; if a user enters the area and stays in the area for a specified time period, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
latitudedoubleCenter latitude of an area. The unit is degree and the value range is [–90°,90°].
longitudedoubleCenter longitude of an area. The unit is degree and the value range is (–180°,180°].
radiusdoubleRadius of an area. The unit is meter.

ScreenBarrier

Screen barriers, including the status keeping, screen-on, screen-off, and screen-unlock barriers. You should remind users that the screen status of their phones may be monitored by the app.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
screenStatusintScreen status.
Constructor Summary
ConstructorDescription
ScreenBarrier.keeping(String barrierLabel, int screenStatus)Screen status barrier named keeping.
ScreenBarrier.screenOn(String barrierLabel)Screen status barrier named screenOn.
ScreenBarrier.screenOff(String barrierLabel)Screen status barrier named screenOff.
ScreenBarrier.screenUnlock(String barrierLabel)Screen status barrier named screenUnlock.
Constructors
ScreenBarrier.keeping(String barrierLabel, int screenStatus)

After you add this barrier for a screen state such as ScreenOn, ScreenOff, or Unlock, if the screen keeps in this state, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
screenStatusintScreen status.
ScreenBarrier.screenOn(String barrierLabel)

After this barrier is added, when the screen is on but locked, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
ScreenBarrier.screenOff(String barrierLabel)

After this barrier is added, when the screen is off, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
ScreenBarrier.screenUnlock(String barrierLabel)

After this barrier is added, when the screen is unlocked, the barrier status is True and a barrier event is reported. After 5s, the barrier status changes to False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.

TimeBarrier

Time barriers, including the barriers to be triggered at a time or periodically based on time.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
timeInstantintSunrise or sunset.
startTimeOffsetintStart time offset of the time barrier.
stopTimeOffsetintStop time offset of the time barrier.
startTimeOfDayintStart time of the barrier, in milliseconds.
stopTimeOfDayintStop time of the barrier, in milliseconds.
startTimeStampintStart timestamp.
stopTimeStampintStop timestamp.
dayOfWeekintDay of a week.
startTimeOfSpecifiedDayintStart time of the barrier, in milliseconds.
stopTimeOfSpecifiedDayintStop time of the barrier, in milliseconds.
inTimeCategoryintTime.
timeZoneIdStringSets the time zone.
Constants
  • For more datailed information, please refer to Official Huawei Awareness Flutter Plugin Documentation.
Constructor Summary
ConstructorDescription
TimeBarrier.inSunriseOrSunsetPeriod(String barrierLabel, int timeInstant, int startTimeOffset, int stopTimeOffset)Sunrise and sunset barrier.
TimeBarrier.duringPeriodOfDay(String barrierLabel, int startTimeOfDay, int stopTimeOfDay, String timeZoneId)Barrier of a specified time period.
TimeBarrier.duringTimePeriod(String barrierLabel, int startTimeStamp, int stopTimeStamp)Time period barrier.
TimeBarrier.duringPeriodOfWeek(String barrierLabel, int dayOfWeek, int startTimeOfSpecifiedDay, int stopTimeOfSpecifiedDay, String timeZoneId)Barrier for a specific day of a week.
TimeBarrier.inTimeCategory(String barrierLabel, int inTimeCategory)Time barrier.
  • android.permission.ACCESS_FINE_LOCATION permission is required for TimeBarrier.inSunriseOrSunsetPeriod, TimeBarrier.duringPeriodOfDay and TimeBarrier.duringPeriodOfWeek barriers.
Constructors
TimeBarrier.inSunriseOrSunsetPeriod(String barrierLabel, int timeInstant, int startTimeOffset, int stopTimeOffset)

After this barrier is added, when the time is in the specified time period using the sunrise or sunset time as the benchmark, the barrier status is True. Otherwise, the barrier status is False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
timeInstantintSunrise or sunset.
startTimeOffsetintStart time offset of the time barrier. The unit is millisecond. The value range is milliseconds from –24 hours to +24 hours. The value must be less than the value of stopTimeOffset.
stopTimeOffsetintStop time offset of the time barrier. The unit is millisecond. The value range is milliseconds from –24 hours to +24 hours. The value must be greater than the value of startTimeOffset.
TimeBarrier.duringPeriodOfDay(String barrierLabel, int startTimeOfDay, int stopTimeOfDay, String timeZoneId)

After this barrier is added, when the time is in the specified time period of a specified time zone, the barrier status is True. Otherwise, the barrier status is False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
startTimeOfDayintStart time of the barrier, in milliseconds. The value 0 indicates 00:00. The maximum value is the number of milliseconds of 24 hours.
stopTimeOfDayintStop time of the barrier, in milliseconds. The value of stopTimeOfDay must be greater than or equal to the value of startTimeOfDay.
timeZoneIdStringTime zone specified by you. If the time zone does not exist, the time zone of the area where the user is located is used.
TimeBarrier.duringTimePeriod(String barrierLabel, int startTimeStamp, int stopTimeStamp)

After this barrier is added, when the time is in the specified time period, the barrier status is True. Otherwise, the barrier status is False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
startTimeStampintStart timestamp. The value must be greater than or equal to 0.
stopTimeStampintStop timestamp. The value of stopTimeStamp must be greater than or equal to that of startTimeStamp.
TimeBarrier.duringPeriodOfWeek(String barrierLabel, int dayOfWeek, int startTimeOfSpecifiedDay, int stopTimeOfSpecifiedDay, String timeZoneId)

After this barrier is added, when the time is in the specified time period on a day of a week in a specified time zone, the barrier status is True. Otherwise, the barrier status is False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
dayOfWeekintDay of a week.
startTimeOfSpecifiedDayintStart time of the barrier, in milliseconds. The value 0 indicates 00:00. The maximum value is the number of milliseconds of 24 hours.
stopTimeOfSpecifiedDayintStop time of the barrier, in milliseconds. The value of stopTimeOfSpecifiedDay must be greater than or equal to the value of startTimeOfSpecifiedDay.
timeZoneIdStringSets the time zone. If the time zone does not exist, the time zone of the area where the user is located is used.
TimeBarrier.inTimeCategory(String barrierLabel, int inTimeCategory)

After this barrier is added, the barrier status is True for the specified time. Otherwise, the barrier status is False.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
inTimeCategoryintTime.

WiFiBarrier

Wi-Fi barriers, including the keeping (Wi-Fi status keeping), connecting (Wi-Fi connection), disconnecting (Wi-Fi disconnection), enabling (WLAN enabling), and disabling (WLAN disabling) barriers.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
wifiStatusintWi-Fi status.
bssidString(BSSID) Physical address of the Wi-Fi source.
ssidString(SSID) Name of the Wi-Fi source.
Constructor Summary
ConstructorDescription
WiFiBarrier.keeping(String barrierLabel, int wifiStatus, String bssid, String ssid)Wi-Fi status barrier named keeping.
WiFiBarrier.connecting(String barrierLabel, String bssid, String ssid)Wi-Fi status barrier named connecting.
WiFiBarrier.disconnecting(String barrierLabel, String bssid, String ssid)Wi-Fi status barrier named disconnecting.
WiFiBarrier.enabling(String barrierLabel)Wi-Fi status barrier named enabling.
WiFiBarrier.disabling(String barrierLabel)Wi-Fi status barrier named disabling.
Constructors
WiFiBarrier.keeping(String barrierLabel, int wifiStatus, String bssid, String ssid)

After you add this barrier for a Wi-Fi state such as Enabled, Disabled, Connected, or Disconnected, if the Wi-Fi keeps in this state, the barrier status is True and a barrier event is reported.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
wifiStatusintWi-Fi status.
bssidStringIf the value of wifiStatus is Connected or Disabled, the BSSID (physical address of the Wi-Fi source) of the Wi-Fi barrier can be specified. The value null indicates any BSSID. If the value of wifiStatus is Enabled or Disabled, the BSSID is invalid.
ssidStringIf the value of wifiStatus is Connected or Disconnected, the SSID (name of the Wi-Fi source) of the Wi-Fi barrier can be specified. The value null indicates any SSID. If the value of wifiStatus is Enabled or Disabled, the SSID is invalid.
WiFiBarrier.connecting(String barrierLabel, String bssid, String ssid)

When a device connects to a Wi-Fi, the barrier status is True and a barrier event is reported. The value automatically changes to False 5s later. If GPS is disabled on the device, the barrier status cannot be correctly determined.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
bssidStringBSSID (physical address of the Wi-Fi source) of a specific Wi-Fi. The value null indicates any BSSID.
ssidStringSSID (name of the Wi-Fi source) of a specific Wi-Fi. The value null indicates any SSID.
WiFiBarrier.disconnecting(String barrierLabel, String bssid, String ssid)

When a device disconnects from a Wi-Fi, the barrier status is True and a barrier event is reported. The value automatically changes to False 5s later.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
bssidStringBSSID (physical address of the Wi-Fi source) of a specific Wi-Fi. The value null indicates any BSSID.
ssidStringSSID (name of the Wi-Fi source) of a specific Wi-Fi. The value null indicates any SSID.
WiFiBarrier.enabling(String barrierLabel)

When a device enables WLAN, the barrier status is True and a barrier event is reported. The value automatically changes to False 5s later.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
WiFiBarrier.disabling(String barrierLabel)

When a device disables WLAN, the barrier status is True and a barrier event is reported. The value automatically changes to False 5s later.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.

Barrier

Registered barrier information.

Properties
NameTypeDescription
barrierLabelStringBarrier label.
barrierStatusBarrierStatusBarrier status.
Constructor Summary
ConstructorDescription
Barrier(String barrierLabel, BarrierStatus barrierStatus)Default constructor.
Constructors
Barrier(String barrierLabel, BarrierStatus barrierStatus)

Constructor for Barrier object.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.
barrierStatusBarrierStatusBarrier status.

BarrierStatus

The barrier status includes the barrier label, current status, previous status, and last status update time.

Properties
NameTypeDescription
barrierLabelStringKey value that uniquely identifies a barrier.
lastBarrierUpdateTimeintThe timestamp of the last barrier status change.
lastStatusintThe previous barrier status.
presentStatusintThe current barrier status.
Constants
ConstantTypeValueDescription
Trueint1Barrier status TRUE.
Falseint0Barrier status FALSE.
Unknownint2Barrier status UNKNOWN.
Constructor Summary
ConstructorDescription
BarrierStatus(String barrierLabel, int lastBarrierUpdateTime, int lastStatus, int presentStatus)Default constructor.
Constructors
BarrierStatus(String barrierLabel, int lastBarrierUpdateTime, int lastStatus, int presentStatus)

Constructor for BarrierStatus object.

Parameters

NameTypeDescription
barrierLabelStringKey value that uniquely identifies a barrier.
lastBarrierUpdateTimeintThe timestamp of the last barrier status change.
lastStatusintThe previous barrier status.
presentStatusintThe current barrier status.

BarrierDeleteRequest

Deletes a barrier based on the key value.

Constructor Summary
ConstructorDescription
BarrierDeleteRequest.all()Creates a BarrierDeleteRequest object that deletes all registered barriers.
BarrierDeleteRequest.withLabel(String barrierLabel)Creates a BarrierDeleteRequest object that deletes the specified barrier.
Constructors
BarrierDeleteRequest.all()

Creates a BarrierDeleteRequest object that deletes all registered barriers.

BarrierDeleteRequest.withLabel(String barrierLabel)

Creates a BarrierDeleteRequest object that deletes the specified barrier.

Parameters

NameTypeDescription
barrierLabelStringBarrier label.

BarrierQueryRequest

Barrier query request.

Constructor Summary
ConstructorDescription
BarrierQueryRequest.all()Creates a BarrierQueryRequest object that queries all registered barriers.
BarrierQueryRequest.forBarriers(List<String> barrierKeys)Creates a BarrierQueryRequest object that queries the specified barriers.
Constructors
BarrierQueryRequest.all()

Creates a BarrierQueryRequest object that queries all registered barriers.

BarrierQueryRequest.forBarriers(List<String> barrierKeys)

Creates a BarrierQueryRequest object that queries the specified barriers.

Parameters

NameTypeDescription
barrierKeysList<String>Barrier labels.

BarrierQueryResponse

Barrier query response.

Properties
NameTypeDescription
barriersList<Barrier>List of registered barriers.
Constructor Summary
ConstructorDescription
BarrierQueryResponse(List<Barrier> barriers)Default constructor.
Constructors
BarrierQueryResponse(List<Barrier> barriers)

Constructor for BarrierQueryResponse object.

Parameters

NameTypeDescription
barriersList<Barrier> barriersList of registered barriers.

ApplicationResponse

Response to the request for obtaining the app status corresponding to a package, which can be obtained by calling the getApplicationStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
applicationStatusintThe application status.
Constructor Summary
ConstructorDescription
ApplicationResponse(int applicationStatus)Default constructor.
Constructors
ApplicationResponse(int applicationStatus)

Constructor for ApplicationResponse object.

Parameters

NameTypeDescription
applicationStatusintThe application status.

BeaconResponse

Response to the request for obtaining the beacon status, which can be obtained by calling the getBeaconStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
beaconsList<BeaconData>Beacon device status information.
Constructor Summary
ConstructorDescription
BeaconResponse(List<BeaconData> beacons)Default constructor.
Constructors
BeaconResponse(List<BeaconData> beacons)

Constructor for BeaconResponse object.

Parameters

NameTypeDescription
beaconsList<BeaconData>Beacon device status information.

BehaviorResponse

Response to the request for obtaining the user behavior, which can be obtained by calling the getBehavior method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
elapsedRealtimeMillisintActual time (in milliseconds) used for this detection since startup.
timeintTimestamp of the current detection.
mostLikelyBehaviorDetectedBehaviorMost likely behavior.
probableBehaviorList<DetectedBehavior>Detected behaviors, which are sorted by confidence (most likely first).
Constructor Summary
ConstructorDescription
BehaviorResponse(int elapsedRealtimeMillis, int time, DetectedBehavior mostLikelyBehavior, List<DetectedBehavior> probableBehavior)Default constructor.
Constructors
BehaviorResponse(int elapsedRealtimeMillis, int time, DetectedBehavior mostLikelyBehavior, List<DetectedBehavior> probableBehavior)

Constructor for BehaviorResponse object.

Parameters

NameTypeDescription
elapsedRealtimeMillisintActual time (in milliseconds) used for this detection since startup.
timeintTimestamp of the current detection.
mostLikelyBehaviorDetectedBehaviorMost likely behavior.
probableBehaviorList<DetectedBehavior>Detected behaviors, which are sorted by confidence (most likely first).

BluetoothResponse

Response to the request for obtaining the Bluetooth car stereo status, which can be obtained by calling the getBluetoothStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
bluetoothStatusintBluetooth status.
Constructor Summary
ConstructorDescription
BluetoothResponse(int bluetoothStatus)Default constructor.
Constructors
BluetoothResponse(int bluetoothStatus)

Constructor for BluetoothResponse object.

Parameters

NameTypeDescription
bluetoothStatusintBluetooth status.

CapabilityResponse

Response to the request for obtaining supported capabilities, which can be obtained by calling the querySupportingCapabilities method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
deviceSupportCapabilitiesList<int>Status constants of capabilities supported by Awareness Kit on the current device.
Constructor Summary
ConstructorDescription
CapabilityResponse(List<int> deviceSupportCapabilities)Default constructor.
Constructors
CapabilityResponse(List<int> deviceSupportCapabilities)

Constructor for CapabilityResponse object.

Parameters

NameTypeDescription
deviceSupportCapabilitiesList<int>Status constants of capabilities supported by Awareness Kit on the current device.

DarkModeResponse

Response to the request for obtaining the dark mode status, which can be obtained by calling the getDarkModeStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
isDartModeOnboolDark mode status.
Constructor Summary
ConstructorDescription
DarkModeResponse(bool isDarkModeOn)Default constructor.
Constructors
DarkModeResponse(bool isDarkModeOn)

Constructor for DarkModeResponse object.

Parameters

NameTypeDescription
isDarkModeOnboolDark mode status.

HeadsetResponse

Response to the request for obtaining the headset status, which can be obtained by calling the getHeadsetStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
headsetStatusintHeadset status.
Constructor Summary
ConstructorDescription
HeadsetResponse(int headsetStatus)Default constructor.
Constructors
HeadsetResponse(int headsetStatus)

Constructor for HeadsetResponse object.

Parameters

NameTypeDescription
headsetStatusintHeadset status.

LightIntensityResponse

Response to the request for obtaining the illuminance, which can be obtained by calling the getLightIntensity method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
lightIntensitydoubleIlluminance value.
Constructor Summary
ConstructorDescription
LightIntensityResponse(double lightIntensity)Default constructor.
Constructors
LightIntensityResponse(double lightIntensity)

Constructor for LightIntensityResponse object.

Parameters

NameTypeDescription
lightIntensitydoubleIlluminance value.

LocationResponse

Response to the location query request. Your app can call the getLocation method provided by AwarenessCaptureClient to obtain the last geographical location response or call the getCurrentLocation method to obtain the current geographical location response.

Properties
NameTypeDescription
latitudedoubleLatitude, in degrees.
longitudedoubleLongitude, in degrees.
altitudedoubleAltitude if available, in meters above the WGS 84 reference ellipsoid.
speeddoubleSpeed if it is available, in meters/second over ground.
bearingdoubleThe bearing, in degrees.
accuracydoubleEstimated horizontal accuracy of this location, radial, in meters.
verticalAccuracyMetersdoubleEstimated vertical accuracy of this location, in meters.
bearingAccuracyDegreesdoubleEstimated bearing accuracy of this location, in degrees.
speedAccuracyMetersPerSeconddoubleEstimated speed accuracy of this location, in meters per second.
timeintTime in milliseconds since January 1, 1970.
fromMockProviderboolLocation provider status.
Constructor Summary
ConstructorDescription
LocationResponse(double latitude, double longitude, double altitude, double speed, double bearing, double accuracy, double verticalAccuracyMeters, double bearingAccuracyDegrees, double speedAccuracyMetersPerSecond, int time, bool fromMockProvider)Default constructor.
Constructors
LocationResponse(double latitude, double longitude, double altitude, double speed, double bearing, double accuracy, double verticalAccuracyMeters, double bearingAccuracyDegrees, double speedAccuracyMetersPerSecond, int time, bool fromMockProvider)

Constructor for LocationResponse object.

Parameters

NameTypeDescription
latitudedoubleLatitude, in degrees.
longitudedoubleLongitude, in degrees.
altitudedoubleAltitude if available, in meters above the WGS 84 reference ellipsoid.
speeddoubleSpeed if it is available, in meters/second over ground.
bearingdoubleThe bearing, in degrees.
accuracydoubleEstimated horizontal accuracy of this location, radial, in meters.
verticalAccuracyMetersdoubleEstimated vertical accuracy of this location, in meters.
bearingAccuracyDegreesdoubleEstimated bearing accuracy of this location, in degrees.
speedAccuracyMetersPerSeconddoubleEstimated speed accuracy of this location, in meters per second.
timeintTime in milliseconds since January 1, 1970.
fromMockProviderboolLocation provider status.

ScreenStatusResponse

Response to the request for obtaining the screen status. You can call the getScreenStatus method provided by AwarenessCaptureClient to obtain the response instance of the screen status.

Properties
NameTypeDescription
screenStatusintDisplays screen status information.
Constructor Summary
ConstructorDescription
ScreenStatusResponse(int screenStatus)Default constructor.
Constructors
ScreenStatusResponse(int screenStatus)

Constructor for ScreenStatus object.

Parameters

NameTypeDescription
screenStatusintDisplays screen status information.

TimeCategoriesResponse

Response to the request for obtaining the time, which can be obtained by calling the getTimeCategories method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
timeCategoriesList<int>Time categories.
Constructor Summary
ConstructorDescription
TimeCategoriesResponse(List<int> timeCategories)Default constructor.
Constructors
TimeCategoriesResponse(List<int> timeCategories)

Constructor for TimeCategoriesResponse object.

Parameters

NameTypeDescription
timeCategoriesList<int>Time categories.

WeatherResponse

Response to the weather query request. You can call the getWeatherByDevice method provided by AwarenessCaptureClient to obtain the weather of the current location of a device, or call the getWeatherByPosition method to obtain the weather of a specified position.

Properties
NameTypeDescription
dailyWeatherList<DailyWeather>Weather information of the next seven days.
hourlyWeatherList<HourlyWeather>Weather information in the next 24 hours.
liveInfoList<LiveInfo>The living index of the current day and the next one to two days.
aqiAqiThe AQI information.
weatherSituationWeatherSituationWeather and city information.
Constants
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.
Constructor Summary
ConstructorDescription
WeatherResponse(List<DailyWeather> dailyWeather, List<HourlyWeather> hourlyWeather, List<LiveInfo> liveInfo, Aqi aqi, WeatherSituation weatherSituation)Default constructor.
Constructors
WeatherResponse(List<DailyWeather> dailyWeather, List<HourlyWeather> hourlyWeather, List<LiveInfo> liveInfo, Aqi aqi, WeatherSituation weatherSituation)

Constructor for WeatherResponse object.

Parameters

NameTypeDescription
dailyWeatherList<DailyWeather>Weather information of the next seven days.
hourlyWeatherList<HourlyWeather>Weather information in the next 24 hours.
liveInfoList<LiveInfo>The living index of the current day and the next one to two days.
aqiAqiThe AQI information.
weatherSituationWeatherSituationWeather and city information.

WiFiResponse

Response to the request for obtaining the Wi-Fi status, which can be obtained by calling the getWifiStatus method provided by AwarenessCaptureClient.

Properties
NameTypeDescription
statusintWi-Fi status of a device.
bssidStringWi-Fi BSSID.
ssidStringWi-Fi SSID.
Constructor Summary
ConstructorDescription
WiFiResponse(int status, String bssid, String ssid)Default constructor.
Constructors
WiFiResponse(int status, String bssid, String ssid)

Constructor for WiFiResponse object.

Parameters

NameTypeDescription
statusintWi-Fi status of a device.
bssidStringWi-Fi BSSID.
ssidStringWi-Fi SSID.

BeaconData

Beacon information.

Properties
NameTypeDescription
beaconIdStringBeacon broadcast ID.
namespaceStringBeacon namespace.
typeStringBeacon type.
contentList<int>Beacon information.
Constructor Summary
ConstructorDescription
BeaconData(String beaconId, String namespace, String type, List<int> content)Default constructor.
Constructors
BeaconData(String beaconId, String namespace, String type, List<int> content)

Constructor for BeaconData object.

Parameters

NameTypeDescription
beaconIdStringBeacon broadcast ID.
namespaceStringBeacon namespace.
typeStringBeacon type.
contentList<int>Beacon information.

DetectedBehavior

Type and confidence of a detected behavior.

Properties
NameTypeDescription
confidenceintConfidence, indicating the possibility that a user is executing the behavior. The value ranges from 0 to 100.
typeintDetected behavior.
Constructor Summary
ConstructorDescription
DetectedBehavior(int confidence, int type)Default constructor.
Constructors
DetectedBehavior(int confidence, int type)

Constructor for DetectedBehavior object.

Parameters

NameTypeDescription
confidenceintConfidence, indicating the possibility that a user is executing the behavior. The value ranges from 0 to 100.
typeintDetected behavior.

WeatherPosition

Request parameter class, which is used to pass address information to obtain weather information. The address information includes six attributes: country, province, city, district, county, and language type.

An address has five attributes: country, province, city, district, and county. The city must be set and other four attributes are optional. For example, if you want to query the weather of London, you can pass only the city attribute "London" or both the country attribute "United Kingdom" and city attribute "London".

The language type is of the locale format. For example, en_GB indicates British English. Note that the language type is mandatory and must meet the locale format language code_country/region code.

If the input address information is invalid, the weather information obtained by the getWeatherByPosition(WeatherPosition position) method is empty.

Properties
NameTypeDescription
countryStringCountry name.
provinceStringProvince name.
cityStringCity name, which is mandatory.
districtStringDistrict name.
countyStringCounty name.
localeStringLanguage type of the passed address, for example, zh_CN or en_US. Note that the language type is mandatory and must meet the locale format language code_country/region code.
Constructor Summary
ConstructorDescription
WeatherPosition(String country, String province, String city, String district, String county, String locale)Default contructor.
Constructors
WeatherPosition(String country, String province, String city, String district, String county, String locale)

Constructor for WeatherPosition object.

Parameters

NameTypeDescription
countryStringCountry name.
provinceStringProvince name.
cityStringCity name, which is mandatory.
districtStringDistrict name.
countyStringCounty name.
localeStringLanguage type of the passed address, for example, zh_CN or en_US. Note that the language type is mandatory and must meet the locale format language code_country/region code.

Aqi

Air quality indexes. The indexes include those about the concentration of carbon monoxide (CO), nitrogen dioxide (NO2), ozone (O3), PM10, PM2.5, and sulphur dioxide (SO2), as well as the AQI. This class supports only data in China.

Properties
NameTypeDescription
aqiValueintAQI information.
cointCO concentration index, which is the average value in 8 hours, in mg/m3.
no2intNO2 concentration index, which is the average value in 1 hour, in μg/m3.
o3intO3 concentration index, which is the average value in 1 hour, in μg/m3.
pm10intPM10 concentration index (the diameter of particles is less than or equal to 10 μm), which is the average value in 24 hours, in μg/m3.
pm25intPM2.5 concentration index (the diameter of particles is less than or equal to 2.5 μm), which is the average value in 24 hours, in μg/m3.
so2intSO2 concentration index, which is the average value in 1 hour, in μg/m3.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

City

City information including the city code, province name, time zone, and city/district name.

Properties
NameTypeDescription
cityCodeStringCode used in Awareness Kit to identify the state/province, city, county, and town in the world.
nameStringTime zone of the city in Alson format. Example: Asia/shanghai
provinceNameStringProvince name, which may be set to null.
timeZoneStringCity/district/town name.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

DailyLiveInfo

Information about a living index on a day. The indexes are about dressing, sports, temperature, car washing, tourism, and UV. This class supports only data in China.

Properties
NameTypeDescription
dateTimeStampintTimestamp of a living index, which is 00:00 of the local location.
levelStringLevel of a living index. For example, a dressing index has six levels from 1 to 6.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

DailySituation

Weather conditions in the daytime or at night, including the weather ID, wind speed, wind level, and wind direction.

Properties
NameTypeDescription
cnWeatherIdintThe weather ID. Weather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
weatherIdintThe weather ID. Weather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
windDirStringThe wind direction. The options are NE (northeast), E (east), SE (southeast), S (south), SW (southwest), W (west), N (north), and NW (northwest).
windLevelintThe wind level. The value ranges from 0 to 17. The value 0 indicates a breeze in China and no wind outside China.
windSpeedintObtains the wind speed (unit: km/h).
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

DailyWeather

Weather information of the current day and the next six to seven days, including the moonrise, moonset, sunrise, sunset, lowest temperature and highest temperature (Celsius and Fahrenheit), local timestamp in the early morning, month phase, weather in daytime (specified by DailySituation), and weather at night (specified by DailySituation).

Properties
NameTypeDescription
aqiValueintAQI information.
dateTimeStampintThe timestamp of the weather of a day, which is 00:00 of the local location.
maxTempCintThe highest temperature (Celsius) of a day.
maxTempFintThe highest temperature (Fahrenheit) of a day.
minTempCintThe lowest temperature (Celsius) of a day.
minTempFintThe lowest temperature (Fahrenheit) of a day.
moonRiseintThe moonrise of a day.
moonSetintThe moonset of a day.
moonPhaseStringThe Moon phase of a day. The options are New, Waxingcrescent, First, WaxingGibbous, Full, WaningGibbous, Last, and WaningCrescent.
situationDayDailySituationThe weather information in the daytime.
situationNightDailySituationThe weather information at night.
sunRiseintThe sunrise of a day.
sunSetintThe sunset of a day.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

HourlyWeather

Weather information in the current hour and the next 24 hours, including the weather ID, time, temperature (Celsius and Fahrenheit), rainfall probability, and whether it is in the daytime or at night.

Properties
NameTypeDescription
cnWeatherIdintWeather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
dateTimeStampintThe timestamp in the current hour.
isDayNightboolStatus indicates whether it is in the daytime or at night.
rainProbabilityintThe rainfall probability, in percentage.
tempCintThe current temperature (Celsius).
tempFintThe current temperature (Fahrenheit).
weatherIdintWeather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

LiveInfo

Living index level for the day and the next one or two days, including the code and level for the current day and next one to two days. This class supports only data in China.

Properties
NameTypeDescription
codeStringThe living index code.
levelListList<DailyLiveInfo>Index level information of the current day and the next one to two days.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

Situation

Current weather information. The information includes the weather ID, humidity, atmospheric temperature (Celsius and Fahrenheit), somatosensory temperature (Celsius and Fahrenheit), wind direction, wind level, wind speed, atmospheric pressure, UV intensity, and update time.

Properties
NameTypeDescription
cnWeatherIdintThe weather ID. Weather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
humidityStringThe humidity, in percentage.
pressureintThe atmospheric pressure, in hPa.
realFeelCintThe somatosensory temperature (Celsius).
realFeelFintThe somatosensory temperature (Fahrenheit).
temperatureCintThe current atmospheric temperature (Celsius).
temperatureFintThe current temperature (Fahrenheit).
updateTimeintThe release time of the weather broadcast.
uvIndexintThe current UV intensity.
weatherIdintThe weather ID. Weather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain.
windDirStringThe wind direction. The options are NE (northeast), E (east), SE (southeast), S (south), SW (southwest), W (west), N (north), and NW (northwest).
windSpeedintThe wind speed (unit: km/h).
windLevelintThe wind level. The value ranges from 0 to 17. 0: no wind
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

WeatherSituation

Current weather information, which consists of the current weather information (specified by Situation) and city information (specified by City).

Properties
NameTypeDescription
cityCityThe city information of the current weather.
situationSituationThe current weather information. The information includes the weather ID, humidity, atmospheric temperature (Celsius and Fahrenheit), somatosensory temperature (Celsius and Fahrenheit), wind direction, wind level, wind speed, atmospheric pressure, UV intensity, and update time.
  • For details please refer to Official Huawei Awareness Flutter Plugin Documentation.

BeaconFilter

Represents filter for beacons.

Properties
NameTypeDescription
beaconNamespaceStringBeacon namespace.
beaconTypeStringBeacon type.
beaconContentUint8ListBeacon context.
beaconIdStringBeacon broadcast ID. Currently, the Eddystone-UID and iBeacon ID (combination of UUID, major, and minor values) are supported.
Constructor Summary
ConstructorDescription
BeaconFilter.matchByNameType(String beaconNamespace, String beaconType)Creates a beacon filter based on the beacon namespace and type.
BeaconFilter.matchByBeaconContent(String beaconNamespace, String beaconType, Uint8List beaconContent)Creates a beacon filter based on the specified beacon namespace, type, and content.
BeaconFilter.matchByBeaconId(String beaconId)Creates a beacon filter based on a specified beacon broadcast ID.
Constructors
BeaconFilter.matchByNameType(String beaconNamespace, String beaconType)

Creates a beacon filter based on the beacon namespace and type.

Parameters

NameTypeDescription
beaconNamespaceStringBeacon namespace.
beaconTypeStringBeacon type.
BeaconFilter.matchByBeaconContent(String beaconNamespace, String beaconType, Uint8List beaconContent)

Creates a beacon filter based on the specified beacon namespace, type, and content.

Parameters

NameTypeDescription
beaconNamespaceStringBeacon namespace.
beaconTypeStringBeacon type.
beaconContentUint8ListBeacon context.
BeaconFilter.matchByBeaconId(String beaconId)

Creates a beacon filter based on a specified beacon broadcast ID.

Parameters

NameTypeDescription
beaconIdStringBeacon broadcast ID. Currently, the Eddystone-UID and iBeacon ID (combination of UUID, major, and minor values) are supported.

4. Configuration and Description #

Preparing for Release #

Before building a release version of your app you may need to customize the proguard-rules.pro obfuscation configuration file to prevent the HMS Core SDK from being obfuscated. Add the configurations below to exclude the HMS Core SDK from obfuscation. For more information on this topic refer to this Android developer guide.

<flutter_project>/android/app/proguard-rules.pro

-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep class com.huawei.hms.flutter.** { *; }

# Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-dontwarn io.flutter.embedding.**

<flutter_project>/android/app/build.gradle

buildTypes {
    debug {
        signingConfig signingConfigs.config
    }
    release {
        signingConfig signingConfigs.config
        // Enables code shrinking, obfuscation and optimization for release builds
        minifyEnabled true
        // Unused resources will be removed, resources defined in the res/raw/keep.xml will be kept.
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

5. Sample Project #

This plugin includes a demo project in the example folder, there you can find more usage examples.


6. Questions or Issues #

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.
  • Github is the official repository for these plugins, You can open an issue or submit your ideas.
  • Huawei Developer Forum HMS Core Module is great for general questions, or seeking recommendations and opinions.
  • Huawei Developer Docs is place to official documentation for all HMS Core Kits, you can find detailed documentations in there.

If you run into a bug in our samples, please submit an issue to the GitHub repository.


7. Licensing and Terms #

Huawei Awareness Kit Flutter Plugin is licensed under Apache 2.0 license

1
likes
80
pub points
0%
popularity

Publisher

developer.huawei.com

HUAWEI Awareness Kit provides your app with the ability to obtain contextual information including users' time, location, behavior, ambient light, weather, and nearby beacons.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on huawei_awareness