diff --git a/GoogleService-Info.plist b/GoogleService-Info.plist
deleted file mode 100644
index 0c093a2a..00000000
--- a/GoogleService-Info.plist
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- CLIENT_ID
- 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com
- REVERSED_CLIENT_ID
- com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r
- API_KEY
- AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs
- GCM_SENDER_ID
- 864393916058
- PLIST_VERSION
- 1
- BUNDLE_ID
- com.cloud.diplomaticquarterapp
- PROJECT_ID
- diplomaticquarter-d2385
- STORAGE_BUCKET
- diplomaticquarter-d2385.appspot.com
- IS_ADS_ENABLED
-
- IS_ANALYTICS_ENABLED
-
- IS_APPINVITE_ENABLED
-
- IS_GCM_ENABLED
-
- IS_SIGNIN_ENABLED
-
- GOOGLE_APP_ID
- 1:864393916058:ios:13f787bbfe6051f8b97923
- DATABASE_URL
- https://diplomaticquarter-d2385.firebaseio.com
-
-
\ No newline at end of file
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 11e99a2a..d88df7fe 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -39,7 +39,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.cloud.diplomaticquarterapp"
+// applicationId "com.cloud.diplomaticquarterapp"
+ applicationId "com.ejada.hmg"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
diff --git a/android/app/google-services.json b/android/app/google-services.json
old mode 100644
new mode 100755
index a4655794..dd4038cf
--- a/android/app/google-services.json
+++ b/android/app/google-services.json
@@ -1,37 +1,39 @@
{
"project_info": {
- "project_number": "864393916058",
- "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com",
- "project_id": "diplomaticquarter-d2385",
- "storage_bucket": "diplomaticquarter-d2385.appspot.com"
+ "project_number": "815750722565",
+ "firebase_url": "https://api-project-815750722565.firebaseio.com",
+ "project_id": "api-project-815750722565",
+ "storage_bucket": "api-project-815750722565.appspot.com"
},
"client": [
{
"client_info": {
- "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923",
+ "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
"android_client_info": {
- "package_name": "com.cloud.diplomaticquarterapp"
+ "package_name": "com.ejada.hmg"
}
},
"oauth_client": [
{
- "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
+ "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
- "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM"
+ "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
}
],
"services": {
+ "analytics_service": {
+ "status": 1
+ },
"appinvite_service": {
- "other_platform_oauth_client": [
- {
- "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com",
- "client_type": 3
- }
- ]
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 2
}
}
}
diff --git a/android/app/gradle/wrapper/gradle-wrapper.properties b/android/app/gradle/wrapper/gradle-wrapper.properties
index 8fc3bbec..a2c20300 100644
--- a/android/app/gradle/wrapper/gradle-wrapper.properties
+++ b/android/app/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
+#distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 1a3d4cfe..1238814b 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -34,7 +34,7 @@
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
- android:label="diplomaticquarterapp">
+ android:label="Dr. Alhabib">
+
+
+
+
+
+
+
diff --git a/assets/images/pharmacy/empty_box.png b/assets/images/pharmacy/empty_box.png
new file mode 100644
index 00000000..af3551fd
Binary files /dev/null and b/assets/images/pharmacy/empty_box.png differ
diff --git a/google-services.json b/google-services_DQ.json
similarity index 100%
rename from google-services.json
rename to google-services_DQ.json
diff --git a/google-services_HMG.json b/google-services_HMG.json
new file mode 100755
index 00000000..dd4038cf
--- /dev/null
+++ b/google-services_HMG.json
@@ -0,0 +1,42 @@
+{
+ "project_info": {
+ "project_number": "815750722565",
+ "firebase_url": "https://api-project-815750722565.firebaseio.com",
+ "project_id": "api-project-815750722565",
+ "storage_bucket": "api-project-815750722565.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
+ "android_client_info": {
+ "package_name": "com.ejada.hmg"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw"
+ }
+ ],
+ "services": {
+ "analytics_service": {
+ "status": 1
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 2
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/hms-plugins/flutter-hms-location/.docs/images/homeScreen.jpg b/hms-plugins/flutter-hms-location/.docs/images/homeScreen.jpg
new file mode 100644
index 00000000..abfc5b99
Binary files /dev/null and b/hms-plugins/flutter-hms-location/.docs/images/homeScreen.jpg differ
diff --git a/hms-plugins/flutter-hms-location/CHANGELOG.md b/hms-plugins/flutter-hms-location/CHANGELOG.md
new file mode 100644
index 00000000..8c43b7b8
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/CHANGELOG.md
@@ -0,0 +1,12 @@
+## 5.0.0+301
+
+* Added the getNavigationContextState function.
+* Added the enableLogger and disableLogger methods.
+
+## 4.0.4+1/4.0.4+300
+
+* Fix minor issues.
+
+## 4.0.4
+
+* Initial release.
diff --git a/hms-plugins/flutter-hms-location/LICENSE b/hms-plugins/flutter-hms-location/LICENSE
new file mode 100644
index 00000000..7783de53
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/LICENSE
@@ -0,0 +1,53 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/hms-plugins/flutter-hms-location/README.md b/hms-plugins/flutter-hms-location/README.md
new file mode 100644
index 00000000..cb69c34a
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/README.md
@@ -0,0 +1,1737 @@
+# Huawei Location Kit Flutter Plugin
+
+## Table of Contents
+* [Introduction](#introduction)
+* [Installation Guide](#installation-guide)
+ * [Creating Project in App Gallery Connect](#creating-project-in-app-gallery-connect)
+ * [Configuring the Signing Certificate Fingerprint](#configuring-the-signing-certificate-fingerprint)
+ * [Integrating the Flutter Location Plugin](#integrating-the-flutter-location-plugin)
+* [API Reference](#api-reference)
+ * [Overview](#overview)
+ * [FusedLocationProviderClient](#fusedlocationproviderclient)
+ * [Location](#location)
+ * [HWLocation](#hwlocation)
+ * [LocationAvailability](#locationavailability)
+ * [LocationCallback](#locationcallback)
+ * [LocationRequest](#locationrequest)
+ * [LocationResult](#locationresult)
+ * [LocationSettingsRequest](#locationsettingsrequest)
+ * [LocationSettingsStates](#locationsettingsstates)
+ * [NavigationResult](#navigationresult)
+ * [NavigationRequest](#navigationrequest)
+ * [ActivityIdentificationService](#activityidentificationservice)
+ * [ActivityConversionData](#activityconversiondata)
+ * [ActivityConversionInfo](#activityconversioninfo)
+ * [ActivityConversionResponse](#activityconversionresponse)
+ * [ActivityIdentificationData](#activityidentificationdata)
+ * [ActivityIdentificationResponse](#activityidentificationresponse)
+ * [Geofence Service](#geofence-service)
+ * [GeofenceData](#geofencedata)
+ * [GeofenceRequest](#geofencerequest)
+ * [PermissionHandler](#permissionhandler)
+ * [HMSLogger](#hmslogger)
+
+* [Configuration Description](#configuration-description)
+* [Sample Project](#sample-project)
+* [Questions or Issues](#questions-or-issues)
+* [Licensing and Terms](#licensing-and-terms)
+
+## Introduction
+
+This plugin enables communication between Huawei Location SDK and Flutter platform. Huawei Location Kit combines the GPS, Wi-Fi, and base station locations to help you quickly obtain precise user locations, build up global positioning capabilities, and reach a wide range of users around the globe.Currently, it provides the four main capabilities: fused location, location semantics, activity identification, and geofence. You can call relevant capabilities as needed.
+
+Huawei Location Kit provides the following core capabilities:
+- **Fused location**: Provides a set of simple and easy-to-use APIs for you to quickly obtain the device location based on the GPS, Wi-Fi, and base station location data.
+- **Activity identification**: Identifies user motion status through the acceleration sensor, cellular network information, and magnetometer, helping you adjust your app based on user behavior.
+- **Geofence**: Allows you to set an interested area through an API so that your app can receive a notification when a specified action (such as leaving, entering, or lingering in the area) occurs.
+
+## Installation Guide
+
+- Before you get started, you must register as a HUAWEI developer and complete identity verification on the [HUAWEI Developer](https://developer.huawei.com/consumer/en/) website. For details, please refer to [Register a HUAWEI ID](https://developer.huawei.com/consumer/en/doc/10104).
+
+- 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:
+
+### Creating Project in App Gallery Connect
+
+**Step 1.** Sign in to [AppGallery Connect](https://developer.huawei.com/consumer/en) 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 **OK**. (Check mark icon)
+
+### Integrating Flutter Location Plugin
+
+**Step 1:** Sign in [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html) 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** field, click **agconnect-service.json** to download 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 is generated in **Generating a Signature File** 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.
+
+ ```gradle
+ buildscript {
+ repositories {
+ google()
+ jcenter()
+ maven { url 'https://developer.huawei.com/repo/' }
+ }
+
+ dependencies {
+ /*
+ *
+ */
+ classpath 'com.huawei.agconnect:agcp:1.4.1.300'
+ }
+ }
+ ```
+
+ - Go to **allprojects** then configure the Maven repository address for the HMS SDK.
+
+ ```gradle
+ 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 other `apply` entries.
+
+ ```gradle
+ 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 **19** or **higher**.
+ Package name must match with the **package_name** entry in **agconnect-services.json** file.
+
+ ```gradle
+ defaultConfig {
+ applicationId ""
+ minSdkVersion 17
+ /*
+ *
+ */
+ }
+ ```
+ - Copy the signature file that generated in [Generating a Signing Certificate](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#3) to **android/app** directory.
+
+ - Configure the signature in **android** according to the signature file information.
+
+```gradle
+signingConfigs {
+ config {
+ keyAlias keystoreProperties['keyAlias']
+ keyPassword keystoreProperties['keyPassword']
+ storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
+ storePassword keystoreProperties['storePassword']
+ }
+}
+buildTypes {
+ debug {
+ signingConfig signingConfigs.config
+ }
+ release {
+ signingConfig signingConfigs.config
+ }
+}
+```
+
+**Step 10:** On your Flutter project directory find and open your **pubspec.yaml** file and add library to dependencies. For more details please refer the [Using packages](https://flutter.dev/docs/development/packages-and-plugins/using-packages#dependencies-on-unpublished-packages) document.
+
+ ```yaml
+ dependencies:
+ huawei_location:
+ # Replace {library path} with actual library path of Huawei Push Kit Location for Flutter.
+ path: {library path}
+ ```
+
+-**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
+```
+
+## API Reference
+
+### Overview
+
+| Module | Description |
+|----------------------------------|------------------------------------------------------------------------------------------------|
+| FusedLocationProviderClient | With this module you can check the device location settings, get the last known location information once or continuously, set mock location and others. |
+| ActivityIdentificationService | If your app needs to obtain the activity status of the user's device (for example, walking, running, or bicycling) or your app needs to detect activity status change of a user, you can use this module. |
+| GeofenceService | If you are interested in a place, you can create a geofence based on the place. When the device enters the geofence or stays for a duration of time, a notification can be sent to your app. |
+
+### FusedLocationProviderClient
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|----------------------------------|------------------------------------------------------------------------------------------------
+| FusedLocationProviderClient() | Default constructor. |
+
+#### Public Method Summary
+
+| Method | Return Type | Description |
+|------------------------------------------------------------------------------------------------|-----------------------------------|-------------|
+| checkLocationSettings(LocationSettingsRequest locationSettingsRequest) | Future\ | This API is used to check location settings of the device. |
+| getLastLocation() | Future\ | This API is used to obtain the last requested available location. This API does not proactively request the location. Instead, it uses the location cached for the last request. |
+| getLastLocationWithAddress(LocationRequest locationRequest) | Future\ | This API is used to obtain the available location of the last request, including the detailed address information. |
+| getLocationAvailability() | Future\ | This API is used to check whether the location data is available. |
+| setMockMode(bool mockMode) | Future\ | This API is used to specify whether the location provider uses the location mock mode. If yes, the GPS or network location is not used and the location set through setMockLocation (Location) is directly returned. |
+| setMockLocation(Location location) | Future\ | This API is used to set the specific mock location. You must call the setMockMode(boolean) method and set the flag to true before calling this method. |
+| requestLocationUpdates(LocationRequest locationRequest) | Future\ | This API is used to continuously request location updates. |
+| requestLocationUpdatesCb(LocationRequest locationRequest, LocationCallback locationCallback) | Future\ | This API is used to request location updates using the callback. |
+| requestLocationUpdatesExCb(LocationRequest locationRequest, LocationCallback locationCallback) | Future\ | This API is an extended location information service API. It supports high-precision location and is compatible with common location APIs. If the device does not support high-precision location or the app does not request the high-precision location permission, this API returns common location information similar to that returned by the requestLocationUpdates API. |
+| removeLocationUpdates(int requestCode) | Future\ | This API is used to remove location updates from the specified requestCode. |
+| removeLocationUpdatesCb(int callbackId) | Future\ | This API is used to remove location updates of the specified callbackId. |
+| onLocationData | Future\Location\> | This API is used to listen location updates that comes from requestLocationUpdates API method. |
+| getNavigationContextState(int type) | Future\ | Obtains the requested navigation type. |
+
+#### Public Constructors
+
+##### FusedLocationProviderClient()
+
+Constructor for *FusedLocationProviderClient* object.
+
+#### Public Methods
+
+##### Future\ checkLocationSettings(LocationSettingsRequest locationSettingsRequest) *async*
+
+Checks location settings of the device.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| locationSettingsRequest | Location setting request object. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | LocationSettingsStates object if the operation is successful; PlatformException otherwise. |
+
+##### Future\ getLastLocation() *async*
+
+Obtains the available location of the last request. Instead of proactively requesting a location, this method uses the location cached during the last request.
+
+The value null may be returned in the following scenarios:
+- The location function has never been used.
+- The location function is disabled.
+- The device is restored to factory settings.
+
+If real-time location is required, you are advised to proactively call requestLocationUpdates instead of this method. To receive a location once only, you can set numUpdates in LocationRequest to 1.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Location object if the operation is successful; PlatformException otherwise. |
+
+##### Future\ getLastLocationWithAddress(LocationRequest locationRequest) *async*
+
+Obtains the available location of the last request, including the detailed address information. If no location is available, null is returned.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| locationRequest | Location request object. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | HWLocation object if the operation is successful; PlatformException otherwise. |
+
+##### Future\ getLocationAvailability() *async*
+
+Checks whether the location data is available.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | LocationAvailability object if the operation is successful; PlatformException otherwise. |
+
+##### Future\ setMockMode(bool mockMode) *async*
+
+Sets whether the location provider uses the mock mode. If yes, the GPS or network location is not used and the location set through setMockLocation is directly returned.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| mockMode | Indicates whether the location provider uses the mock mode. true: yes; false: no. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Future\ setMockLocation(Location location) *async*
+
+Sets whether the location provider uses the mock mode. If yes, the GPS or network location is not used and the location set through setMockLocation is directly returned.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| location | Mock location. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Future\ requestLocationUpdates(LocationRequest locationRequest) *async*
+
+Continuously requests location updates. You can call the onLocationData API method to listen for location updates.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| locationRequest | Location update request. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Request code if the operation is successful; PlatformException otherwise. The request code can be used to call the removeLocationUpdates method. |
+
+##### Future\ requestLocationUpdatesCb(LocationRequest locationRequest, LocationCallback locationCallback) *async*
+
+Requests location updates using the callback.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| locationRequest | Location update request. |
+| locationCallback | Location update callback.|
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Callback ID if the operation is successful; PlatformException otherwise. The callback ID can be used to call the removeLocationUpdatesCb method. |
+
+##### Future\ requestLocationUpdatesExCb(LocationRequest locationRequest, LocationCallback locationCallback) *async*
+
+Continuously requests location updates. This method is an extended location information service API. It supports high-precision location and is compatible with common location APIs. If the device does not support high-precision location or the app does not request the high-precision location, this method returns common location information similar to that returned by the requestLocationUpdatesCb method.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| locationRequest | Location update request. |
+| locationCallback | Location update callback.|
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Callback ID if the operation is successful; PlatformException otherwise. The callback ID can be used to call the removeLocationUpdatesCb method. |
+
+##### Future\ removeLocationUpdates(int requestCode) *async*
+
+Removes location updates based on the specified request code.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| requestCode | Request code returned by the requestLocationUpdates method. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Future\ removeLocationUpdatesCb(int callbackId) *async*
+
+Removes location updates based on the specified callback ID.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| callbackId | Callback ID returned by the requestLocationUpdatesCb or requestLocationUpdatesExCb method. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Stream\ onLocationData
+
+Listens for location updates that come from the requestLocationUpdates method.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Stream\ | Stream of Location object. You can call the .listen() method to subscribe to this stream and listen for updates. |
+
+##### Future\ getNavigationContextState(int type) *async*
+
+Removes location updates based on the specified callback ID.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| type | Requested navigation type. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | NavigationResult object if the operation is successful; PlatformException otherwise. |
+
+### Location
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------|
+| provider | String | Location provider, such as network location, GPS, Wi-Fi, and Bluetooth. |
+| latitude | double | Latitude of a location. If no latitude is available, 0.0 is returned. |
+| longitude | double | Longitude of a location. If no longitude is available, 0.0 is returned. |
+| altitude | double | Altitude of a location. If no altitude is available, 0.0 is returned. |
+| speed | double | Speed of a device at the current location, in meters per second. If no speed is available, 0.0 is returned. |
+| bearing | double | Bearing of a device at the current location, in degrees. If no bearing is available, 0.0 is returned. |
+| horizontalAccuracyMeters | double | Horizontal error of a location, in meters. If no horizontal error is available, 0.0 is returned. |
+| verticalAccuracyMeters | double | Vertical error of a location, in meters. If no vertical error is available, 0.0 is returned. |
+| speedAccuracyMetersPerSecond | double | Speed error of a device at the current location, in meters per second. If no speed error is available, 0.0 is returned. |
+| bearingAccuracyDegrees | double | Bearing error of the current location, in degrees. If no bearing error is available, 0.0 is returned. |
+| time | int | Current timestamp, in milliseconds. |
+| elapsedRealtimeNanos | int | Time elapsed since the system was started, in nanoseconds |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
+| Location({String provider, double latitude, double longitude, double altitude, double speed, double bearing, double horizontalAccuracyMeters, double verticalAccuracyMeters, double speedAccuracyMetersPerSecond, double bearingAccuracyDegrees, int time, int elapsedRealtimeNanos}) | Default constructor. |
+| Location.fromMap(Map\ map) | Creates a Location object from a map. |
+| Location.fromJson(String source) | Creates a Location object from a JSON string. |
+
+#### Public Constructors
+
+##### Location({String provider, double latitude, double longitude, double altitude, double speed, double bearing, double horizontalAccuracyMeters, double verticalAccuracyMeters, double speedAccuracyMetersPerSecond, double bearingAccuracyDegrees, int time, int elapsedRealtimeNanos})
+
+Constructor for Location object.
+
+| Parameter | Type | Description |
+|------------------------------|--------|-------------------------------------------------------------------------------------------------------------------------|
+| provider | String | Location provider, such as network location, GPS, Wi-Fi, and Bluetooth. |
+| latitude | double | Latitude of a location. If no latitude is available, 0.0 is returned. |
+| longitude | double | Longitude of a location. If no longitude is available, 0.0 is returned. |
+| altitude | double | Altitude of a location. If no altitude is available, 0.0 is returned. |
+| speed | double | Speed of a device at the current location, in meters per second. If no speed is available, 0.0 is returned. |
+| bearing | double | Bearing of a device at the current location, in degrees. If no bearing is available, 0.0 is returned. |
+| horizontalAccuracyMeters | double | Horizontal error of a location, in meters. If no horizontal error is available, 0.0 is returned. |
+| verticalAccuracyMeters | double | Vertical error of a location, in meters. If no vertical error is available, 0.0 is returned. |
+| speedAccuracyMetersPerSecond | double | Speed error of a device at the current location, in meters per second. If no speed error is available, 0.0 is returned. |
+| bearingAccuracyDegrees | double | Bearing error of the current location, in degrees. If no bearing error is available, 0.0 is returned. |
+| time | int | Current timestamp, in milliseconds. |
+| elapsedRealtimeNanos | int | Time elapsed since the system was started, in nanoseconds |
+
+##### Location.fromMap(Map\ map)
+
+Creates a Location object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### Location.fromJson(String source)
+
+Creates a Location object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+
+### HWLocation
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| provider | String | Location provider, such as network location, GPS, Wi-Fi, and Bluetooth. |
+| latitude | double | Latitude of a location. If no latitude is available, 0.0 is returned. |
+| longitude | double | Longitude of a location. If no longitude is available, 0.0 is returned. |
+| altitude | double | Altitude of a location. If no altitude is available, 0.0 is returned. |
+| speed | double | Speed of a device at the current location, in meters per second. If no speed is available, 0.0 is returned. |
+| bearing | double | Bearing of a device at the current location, in degrees. If no bearing is available, 0.0 is returned. |
+| horizontalAccuracyMeters | double | Horizontal error of a location, in meters. If no horizontal error is available, 0.0 is returned. |
+| verticalAccuracyMeters | double | Vertical error of a location, in meters. If no vertical error is available, 0.0 is returned. |
+| speedAccuracyMetersPerSecond | double | Speed error of a device at the current location, in meters per second. If no speed error is available, 0.0 is returned. |
+| bearingAccuracyDegrees | double | Bearing error of the current location, in degrees. If no bearing error is available, 0.0 is returned. |
+| time | int | Current timestamp, in milliseconds. |
+| elapsedRealtimeNanos | int | Time elapsed since the system was started, in nanoseconds |
+| countryCode | String | Country code. The value is a two-letter code complying with the ISO 3166-1 standard. |
+| countryName | String | Country name. |
+| state | String | Administrative region. |
+| city | String | City of the current location. |
+| county | String | County of the current location. |
+| street | String | Street of the current location. |
+| featureName | String | Landmark building at the current location. |
+| postalCode | String | Postal code of the current location. |
+| phone | String | Phone number of the landmark building (such as a store or company) at the current location. |
+| url | String | Website of the landmark building (such as a store or company) at the current location. |
+| extraInfo | Map\ | Additional information, which is a key-value pair. |
+
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
+| HWLocation({String provider, double latitude, double longitude, double altitude, double speed, double bearing, double horizontalAccuracyMeters, double verticalAccuracyMeters, double speedAccuracyMetersPerSecond, double bearingAccuracyDegrees, int time, int elapsedRealtimeNanos, String countryCode, String countryName, String state, String city, String county, String street, String featureName, String postalCode, String phone, String url, Map extraInfo}) | Default constructor. |
+| HWLocation.fromMap(Map\ map) | Creates a HWLocation object from a map. |
+| HWLocation.fromJson(String source) | Creates a HWLocation object from a JSON string. |
+
+#### Public Constructors
+
+##### HwLocation({String provider, double latitude, double longitude, double altitude, double speed, double bearing, double horizontalAccuracyMeters, double verticalAccuracyMeters, double speedAccuracyMetersPerSecond, double bearingAccuracyDegrees, int time, int elapsedRealtimeNanos})
+
+Constructor for Location object.
+
+| Parameter | Type | Description |
+|------------------------------|------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| provider | String | Location provider, such as network location, GPS, Wi-Fi, and Bluetooth. |
+| latitude | double | Latitude of a location. If no latitude is available, 0.0 is returned. |
+| longitude | double | Longitude of a location. If no longitude is available, 0.0 is returned. |
+| altitude | double | Altitude of a location. If no altitude is available, 0.0 is returned. |
+| speed | double | Speed of a device at the current location, in meters per second. If no speed is available, 0.0 is returned. |
+| bearing | double | Bearing of a device at the current location, in degrees. If no bearing is available, 0.0 is returned. |
+| horizontalAccuracyMeters | double | Horizontal error of a location, in meters. If no horizontal error is available, 0.0 is returned. |
+| verticalAccuracyMeters | double | Vertical error of a location, in meters. If no vertical error is available, 0.0 is returned. |
+| speedAccuracyMetersPerSecond | double | Speed error of a device at the current location, in meters per second. If no speed error is available, 0.0 is returned. |
+| bearingAccuracyDegrees | double | Bearing error of the current location, in degrees. If no bearing error is available, 0.0 is returned. |
+| time | int | Current timestamp, in milliseconds. |
+| elapsedRealtimeNanos | int | Time elapsed since the system was started, in nanoseconds |
+| countryCode | String | Country code. The value is a two-letter code complying with the ISO 3166-1 standard. |
+| countryName | String | Country name. |
+| state | String | Administrative region. |
+| city | String | City of the current location. |
+| county | String | County of the current location. |
+| street | String | Street of the current location. |
+| featureName | String | Landmark building at the current location. |
+| postalCode | String | Postal code of the current location. |
+| phone | String | Phone number of the landmark building (such as a store or company) at the current location. |
+| url | String | Website of the landmark building (such as a store or company) at the current location. |
+| extraInfo | Map\ | Additional information, which is a key-value pair. |
+
+##### HWLocation.fromMap(Map map)
+
+Creates a HWLocation object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### HWLocation.fromJson(String source)
+
+Creates a HWLocation object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### LocationAvailability
+
+Device location availability.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|-------------------|------|-----------------------------------------------------------------------------------------------------------|
+| cellStatus | int | Availability status code of cell location. Currently not provided. Value is always **0**. |
+| wifiStatus | int | Availability status code of wifi location. Currently not provided. Value is always **0**. |
+| elapsedRealtimeNs | int | Time elapsed since the system was started, in nanoseconds. Currently not provided. Value is always **0**. |
+| locationStatus | int | Location status code. If the value of smaller than 1000, then device location is available. |
+
+**NOTE:**
+
+Currently, cellStatus, wifiStatus and elapsedRealtimeNs are not provided and have a fixed value of 0.
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|---------------------------------------------------------------------------------------------------|----------------------|
+| LocationAvailability({int cellStatus, int wifiStatus, int elapsedRealtimeNs, int locationStatus}) | Default constructor. |
+| LocationAvailability.fromMap(Map\ map) | Creates a LocationAvailability object from a map. |
+| LocationAvailability.fromJson(String source) | Creates a LocationAvailability object from a JSON string. |
+
+#### Public Method Summary
+
+| Methods | Return Type | Description |
+|---------------------|-------------|------------------------------------------------|
+| isLocationAvailable | bool | Indicates if the location is available or not. |
+
+#### Public Constructors
+
+##### LocationAvailability({int cellStatus, int wifiStatus, int elapsedRealtimeNs, int locationStatus})
+
+Constructor for LocationAvailability object.
+
+| Parameter | Type | Description |
+|-------------------|------|-----------------------------------------------------------------------------------------------------------|
+| cellStatus | int | Availability status code of cell location. Currently not provided. Value is always **0**. |
+| wifiStatus | int | Availability status code of wifi location. Currently not provided. Value is always **0**. |
+| elapsedRealtimeNs | int | Time elapsed since the system was started, in nanoseconds. Currently not provided. Value is always **0**. |
+| locationStatus | int | Location status code. If the value of smaller than 1000, then device location is available. |
+
+##### LocationAvailability.fromMap(Map\ map)
+
+Creates a LocationAvailability object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### LocationAvailability.fromJson(String source)
+
+Creates a LocationAvailability object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+#### Public Methods
+
+##### bool isLocationAvaible
+
+Checks whether the device location is available. If yes, the value true is returned. A number of causes may result in failure to determine the location, such as that the location function is disabled or sensor data cannot be obtained from the device.
+
+| Return Type | Description |
+|------------------------------|----------------------|
+| String | JSON string as a source. |
+
+### LocationCallback
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------------------|----------------------------------------------------------|------------------------------------------------------------|
+| onLocationAvailability | void Function(LocationAvailability locationAvailability) | Callback function to listen location availability changes. |
+| onLocationResult | void Function(LocationResult locationResult) | Callback function to listen location updates. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|------------------------------------------------------------------------------------------|----------------------|
+| LocationCallback({void Function onLocationResult, void Function onLocationAvailability}) | Default constructor. |
+
+#### Public Constructors
+
+##### LocationCallback({void Function onLocationResult, void Function onLocationAvailability})
+
+Constructor for LocationCallback object.
+
+| Parameter | Type | Description |
+|------------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------|
+| onLocationResult | void Function | Callback function to trigger when the device location is available. |
+| onLocationAvailability | void Function | Callback function to trigger when the device location availability changes. |
+
+### LocationRequest
+
+Location request class.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|----------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| priority | int | Request priority. The default value is 100. |
+| interval | int | Request interval, in milliseconds. The default value is 3600000. |
+| fastestInterval | int | Shortest request interval, in milliseconds. The default value is 600000. If another app initiates a location request, the location is also reported to the app at the interval specified in fastestInterval. |
+| expirationTime | int | Request expiration time, in milliseconds. |
+| numUpdates | int | Number of requested location updates. |
+| smallestDisplacement | double | Minimum displacement between location updates, in meters. |
+| maxWaitTime | int | Maximum waiting timeIndicates whether to return the address information. The default value is false. |
+| needAddress | bool | Indicates whether to return the address information. The default value is false. |
+| language | String | Language. The value consists of two letters and complies with the ISO 639-1 international standard. By default, the value is empty. |
+| countryCode | String | Country code. The value consists of two letters and complies with the ISO 3166-1 international standard. By default, the value is empty. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|----------------------------------|------|-------|----------------------------------------------------------------------------------------------------------------------------------------------|
+| PRIORITY_HIGH_ACCURACY | int | 100 | Used to request the most accurate location. |
+| PRIORITY_BALANCED_POWER_ACCURACY | int | 102 | Used to request the block-level location. |
+| PRIORITY_LOW_POWER | int | 104 | Used to request the city-level location. |
+| PRIORITY_NO_POWER | int | 105 | Used to request the location with the optimal accuracy without additional power consumption. |
+| PRIORITY_HD_ACCURACY | int | 200 | Used to request the high-precision location information. Currently, this parameter is available only for the requestLocationUpdatesExCb API. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-------------------------------------------------------|----------------------|
+| LocationRequest() | Default constructor. |
+| LocationRequest.fromMap(Map\ map) | Creates a Location object from a map. |
+| LocationRequest.fromJson(String source) | Creates a Location object from a JSON string. |
+
+#### Public Method Summary
+
+| Return Type | Method | Description |
+|-----------------|--------------------------------|-------------|
+| bool | isFastestIntervalExplicitlySet | Indicates whether the fastest interval explicitly set or default value is being used. |
+
+
+#### Public Constructors
+
+##### LocationRequest()
+
+Constructor for Location object.
+
+##### LocationRequest.fromMap(Map\ map)
+
+Creates a Location object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### LocationRequest.fromJson(String source)
+
+Creates a Location object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+#### Public Methods
+
+##### bool isFastestIntervalExplicitlySet
+
+Checks whether the shortest interval is used.
+
+| Methods | Return Type | Description |
+|--------------------------------|-------------|---------------------------------------------------------------------------------------|
+| isFastestIntervalExplicitlySet | bool | Indicates whether the fastest interval explicitly set or default value is being used. |
+
+### LocationResult
+
+Location data information class.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|----------------|--------------------|-------------------------------------------------------------------------------------------------------|
+| locations | List\ | Available locations, which are ordered from oldest to newest. |
+| hwLocations | List\ | List of available locations sorted from oldest to newest, including the detailed address information. |
+| lastLocation | Location | Available location of the last request. |
+| lastHWLocation | HWLocation | Available location of the last request, including the detailed address information. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|----------------------------------------------------------------------------------------------------------------------------|----------------------|
+| LocationResult({List locations, List hwLocations, Location lastLocation, HWLocation lastHWLocation}) | Default constructor. |
+| LocationResult.fromMap(Map\ map) | Creates a Location object from a map. |
+| LocationResult.fromJson(String source) | Creates a Location object from a JSON string. |
+
+#### Public Constructors
+
+##### LocationResult({List locations, List hwLocations, Location lastLocation, HWLocation lastHWLocation})
+
+Constructor for LocationResult object.
+
+| Parameter | Type | Description |
+|------------------------------|--------------------|-------------------------------------------------------------------------------------------------------------------------|
+| locations | List\ | Available locations, which are sorted from oldest to newest. |
+| hwLocations | List\ | List of available locations sorted from oldest to newest, including the detailed address. |
+| lastLocation | Location | Available location of the last request. |
+| lastHWLocation | HWLocation | Available location of the last request, including the detailed address. |
+
+
+##### LocationResult.fromMap(Map\ map)
+
+Creates a LocationResult object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### LocationResult.fromJson(String source)
+
+Creates a LocationResult object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+
+
+
+### LocationSettingsRequest
+
+Class for specifying the location service types and checking the location settings to obtain optimal functionality of all requested services.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------|-------------------------|--------------------------------------------------------------------------------------------------------------|
+| requests | List\ | Collection of LocationRequest object. |
+| alwaysShow | bool | Indicates whether BLE scanning needs to be enabled. The options are true (yes) and false (no). |
+| needBle | bool | Indicates whether a location is required for the app to continue. The options are true (yes) and false (no). |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|--------------------------------------------------------------------------------------------|----------------------|
+| LocationSettingsRequest({List\ requests, bool alwaysShow, bool needBle}) | Default constructor. |
+| LocationSettingsRequest.fromMap(Map\ map) | Creates a LocationSettingsRequest object from a map. |
+| LocationSettingsRequest.fromJson(String source) | Creates a LocationSettingsRequest object from a JSON string. |
+
+#### Public Constructors
+
+##### LocationSettingsRequest({List\ requests, bool alwaysShow, bool needBle})
+
+Constructor for LocationSettingsRequest object.
+
+| Parameter | Type | Description |
+|-----------------------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| requests | List\ | Collection of LocationRequest objects. |
+| alwaysShow | bool | Indicates whether BLE scanning needs to be enabled. The options are true (yes) and false (no). |
+| needBle | bool | Indicates whether a location is required for the app to continue. The options are true (yes) and false (no). |
+
+##### LocationSettingsRequest.fromMap(Map\ map)
+
+Creates a LocationSettingsRequest object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### LocationSettingsRequest.fromJson(String source)
+
+Creates a LocationSettingsRequest object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### LocationSettingsStates
+
+Current location-related setting status.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------------------|------|----------------------------------------------------------------------------------------|
+| blePresent | bool | Indicates whether the BLE exists on the device. |
+| bleUsable | bool | Indicates whether the BLE is enabled and can be used by the app. |
+| gpsPresent | bool | Indicates whether the GPS provider exists on the device. |
+| gpsUsable | bool | Indicates whether the GPS provider is enabled and can be used by the app. |
+| locationPresent | bool | Indicates whether the location provider exists on the device. |
+| locationUsable | bool | Indicates whether the location provider is enabled and can be used by the app. |
+| networkLocationPresent | bool | Indicates whether the network location provider exists on the device. |
+| networkLocationUsable | bool | Indicates whether the network location provider is enabled and can be used by the app. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
+| LocationSettingsStates({bool blePresent, bool bleUsable, bool gpsPresent, bool gpsUsable, bool locationPresent, bool locationUsable, bool networkLocationPresent, bool networkLocationUsable}) | Default constructor. |
+| LocationSettingsStates.fromMap(Map\ map) | Creates a LocationSettingsStates object from a map. |
+| LocationSettingsStates.fromJson(String source) | Creates a LocationSettingsStates object from a JSON string. |
+
+#### Public Constructors
+
+##### LocationSettingsStates({bool blePresent, bool bleUsable, bool gpsPresent, bool gpsUsable, bool locationPresent, bool locationUsable, bool networkLocationPresent, bool networkLocationUsable})
+
+Constructor for LocationSettingsStates object.
+
+| Parameter | Type | Description |
+|------------------------|------|----------------------------------------------------------------------------------------|
+| blePresent | bool | Indicates whether the BLE exists on the device. |
+| bleUsable | bool | Indicates whether the BLE is enabled and can be used by the app. |
+| gpsPresent | bool | Indicates whether the GPS provider exists on the device. |
+| gpsUsable | bool | Indicates whether the GPS provider is enabled and can be used by the app. |
+| locationPresent | bool | Indicates whether the location provider exists on the device. |
+| locationUsable | bool | Indicates whether the location provider is enabled and can be used by the app. |
+| networkLocationPresent | bool | Indicates whether the network location provider exists on the device. |
+| networkLocationUsable | bool | Indicates whether the network location provider is enabled and can be used by the app. |
+
+##### LocationSettingsStates.fromMap(Map\ map)
+
+Creates a Location object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### LocationSettingsStates.fromJson(String source)
+
+Creates a Location object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### NavigationResult
+
+#### Public Properties
+
+| Methods | Return Type | Description |
+|-------------------|-------------|----------------------------------------------------------------|
+| possibility | int | Obtains the confidence of the status information. The value ranges from 0 to 100. A larger value indicates more reliable result authenticity. |
+| state | int | Status information.If the navigation type is IS_SUPPORT_EX, the return values are described as follows: 11: The user device supports high-precision location.12: The user device does not support high-precision location. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-------------------------------------------------------|----------------------|
+| NavigationResult({state, possibility}) | Default constructor. |
+| NavigationResult.fromMap(Map\ map) | Creates a NavigationResult object from a map. |
+| NavigationResult.fromJson(String source) | Creates a NavigationResult object from a JSON string. |
+
+
+#### Public Constructors
+
+##### NavigationResult({state, possibility})
+
+Constructor for NavigationResult object.
+
+| Parameter | Return Type | Description |
+|-------------------|-------------|----------------------------------------------------------------|
+| possibility | int | Obtains the confidence of the status information. The value ranges from 0 to 100. A larger value indicates more reliable result authenticity. |
+| state | int | Status information.If the navigation type is IS_SUPPORT_EX, the return values are described as follows: 11: The user device supports high-precision location.12: The user device does not support high-precision location. |
+
+
+##### NavigationResult.fromMap(Map\ map)
+
+Creates a NavigationResult object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### NavigationResult.fromJson(String source)
+
+Creates a NavigationResult object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### NavigationRequest
+
+#### Public Properties
+
+| Properties | Type | Description |
+|--------------------------|----------------|--------------------------------------------|
+| type | int | Requested navigation type. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|---------------------------|------|-------|----------------------------------------------------- |
+| IS_SUPPORT_EX | int | 2 | Used to check whether the device supports high-precision location. |
+
+### ActivityIdentificationService
+
+Interaction access point of activity identification.
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|------------------------------------------------|----------------------|
+| ActivityIdentificationService() | Default constructor. |
+
+#### Public Method Summary
+
+| Return Type | Method | Description |
+|------------------------------------------|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Future\ | createActivityIdentificationUpdates(int detectionIntervalMillis) | This API is used to register for activity identification updates. |
+| Future\ | createActivityConversionUpdates(List\ activityConversions) | This API is used to activity conversions (entering and exit), for example, detecting user status change from walking to bicycling.The Conversion API supports the following activity parameters. |
+| Future\ | deleteActivityIdentificationUpdates(int requestCode) | This API is used to remove all activity identification updates from the specified **requestCode**. |
+| Future\ | deleteActivityConversionUpdates(int requestCode) | This API is used to remove all activity conversion updates from the specified **requestCode**. |
+| Stream\ | onActivityIdentification | This API is used to listen activity identification updates that comes from createActivityIdentificationUpdates API method. |
+| Stream\ | onActivityConversion | This API is used to listen activity conversion updates that comes from createActivityConversionUpdates API method. |
+
+
+#### Public Constructors
+
+##### ActivityIdentificationService()
+
+Constructor for ActivityIdentificationService object.
+
+#### Public Methods
+
+##### Future\ createActivityIdentificationUpdates(int detectionIntervalMillis) *async*
+
+Registers for activity identification updates.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| detectionIntervalMillis | Interval for activity identification updates, in milliseconds. A larger value will result in a lower activity identification frequency, while a smaller value will result in a higher activity identification frequency. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Request code if the operation is successful; PlatformException otherwise. The request code can be used to call the deleteActivityIdentificationUpdates method. |
+
+##### Future\ createActivityConversionUpdates(List\ activityConversions) *async*
+
+Registers for activity conversion updates (entering and exit), for example, detecting user status change from walking to bicycling.
+
+| Parameter | Description |
+|---------------------|-------------|
+| activityConversions | Activity conversion list. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Request code if the operation is successful; PlatformException otherwise. The request code can be used to call the deleteActivityConversionUpdates method. |
+
+##### Future\ deleteActivityIdentificationUpdates(int requestCode) *async*
+
+Removes activity identification updates based on the specified request code.
+
+| Parameter | Description |
+|-------------|-------------|
+| requestCode | Request code returned by the createActivityIdentificationUpdates method. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Future\ deleteActivityConversionUpdates(int requestCode) *async*
+
+Removes activity conversion updates based on the specified request code.
+
+| Parameter | Description |
+|-------------|-------------|
+| requestCode | Request code returned by the createActivityConversionUpdates method. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Stream\ onActivityIdentification
+
+Listens for activity identification updates that come from the createActivityIdentificationUpdates method.
+
+| Return Type | Description |
+|------------------------------------------|-------------|
+| Stream\ | Stream of ActivityIdentificationResponse object. You can call the .listen() method to subscribe to this stream and listen for updates. |
+
+##### Stream\ onActivityConversion
+
+Listens for activity conversion updates that come from the createActivityConversionUpdates method.
+
+| Return Type | Description |
+|--------------------------------------|-------------|
+| Stream\ | Stream of ActivityConversionResponse object. You can call the .listen() method to subscribe to this stream and listen for updates. |
+
+### ActivityConversionData
+
+Activity conversion event.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|-----------------------|------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
+| activityType | int | Activity type of the conversion. The value is one of the activity types defined in ActivityIdentificationData. |
+| conversionType | int | Activity conversion information. The options are ActivityConversionInfo.ENTER_ACTIVITY_CONVERSION and ActivityConversionInfo.EXIT_ACTIVITY_CONVERSION. |
+| elapsedTimeFromReboot | int | Elapsed real time (in milliseconds) of this conversion since boot. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-------------------------------------------------------------------------------------------|----------------------|
+| ActivityConversionData({int activityType, int conversionType, int elapsedTimeFromReboot}) | Default constructor. |
+| ActivityConversionData.fromMap(Map\ map) | Creates a ActivityConversionData object from a map. |
+| ActivityConversionData.fromJson(String source) | Creates a ActivityConversionData object from a JSON string. |
+
+#### Public Constructors
+
+##### ActivityConversionData({int activityType, int conversionType, int elapsedTimeFromReboot})
+
+Constructor for ActivityConversionData object.
+
+| Parameter | Type | Description |
+|-----------------------|------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
+| activityType | int | Activity type of the conversion. The value is one of the activity types defined in ActivityIdentificationData. |
+| conversionType | int | Activity conversion information. The options are ActivityConversionInfo.ENTER_ACTIVITY_CONVERSION and ActivityConversionInfo.EXIT_ACTIVITY_CONVERSION. |
+| elapsedTimeFromReboot | int | Elapsed real time (in milliseconds) of this conversion since boot. |
+
+##### ActivityConversionData.fromMap(Map\ map)
+
+Creates a ActivityConversionData object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### ActivityConversionData.fromJson(String source)
+
+Creates a ActivityConversionData object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### ActivityConversionInfo
+
+Activity conversion information.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
+| activityType | int | Activity type of the conversion. The value is one of the activity types defined in ActivityIdentificationData. |
+| conversionType | int | Activity conversion information. The options are ActivityConversionInfo.ENTER_ACTIVITY_CONVERSION and ActivityConversionInfo.EXIT_ACTIVITY_CONVERSION. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|---------------------------|------|-------|-----------------------------------|
+| ENTER_ACTIVITY_CONVERSION | int | 0 | A user enters the given activity. |
+| EXIT_ACTIVITY_CONVERSION | int | 1 | A user exits the given activity. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|----------------------------------------------------------------|----------------------|
+| ActivityConversionInfo({int activityType, int conversionType}) | Default constructor. |
+| ActivityConversionInfo.fromMap(Map\ map) | Creates a ActivityConversionInfo object from a map. |
+| ActivityConversionInfo.fromJson(String source) | Creates a ActivityConversionInfo object from a JSON string. |
+
+#### Public Constructors
+
+##### ActivityConversionInfo({int activityType, int conversionType})
+
+Constructor for ActivityConversionInfo object.
+
+| Properties | Type | Description |
+|----------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
+| activityType | int | Activity type of the conversion. The value is one of the activity types defined in ActivityIdentificationData. |
+| conversionType | int | Activity conversion information. The options are ActivityConversionInfo.ENTER_ACTIVITY_CONVERSION and ActivityConversionInfo.EXIT_ACTIVITY_CONVERSION. |
+
+##### ActivityConversionInfo.fromMap(Map\ map)
+
+Creates a ActivityConversionInfo object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### ActivityConversionInfo.fromJson(String source)
+
+Creates a ActivityConversionInfo object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### ActivityConversionResponse
+
+Activity conversion result.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|-------------------------|--------------------------------|-------------------------------------------------------------------------------------------------------------------|
+| activityConversionDatas | List\ | All activity conversion events in the result. The obtained activity events are sorted by time in ascending order. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|--------------------------------------------------------------------------------------|----------------------|
+| ActivityConversionResponse({List\ activityConversionDatas}) | Default constructor. |
+| ActivityConversionResponse.fromMap(Map\ map) | Creates a ActivityConversionResponse object from a map. |
+| ActivityConversionResponse.fromJson(String source) | Creates a ActivityConversionResponse object from a JSON string. |
+
+#### Public Constructors
+
+##### ActivityConversionResponse({List\ activityConversionDatas})
+
+Constructor for ActivityConversionResponse object.
+
+| Parameter | Type | Description |
+|------------------------------|--------------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| activityConversionDatas | List\ | All activity conversion events in the result. The obtained activity events are sorted by time in ascending order. |
+
+
+##### ActivityConversionResponse.fromMap(Map\ map)
+
+Creates a ActivityConversionResponse object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### ActivityConversionResponse.fromJson(String source)
+
+Creates a ActivityConversionResponse object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### ActivityIdentificationData
+
+Class for detecting the activity.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|------------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
+| identificationActivity | int | Type of the detected activity. |
+| possibility | int | The confidence for the user to execute the activity. The confidence ranges from 0 to 100. A larger value indicates more reliable activity authenticity. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|-----------|------|-------|-----------------------------------------------------------------|
+| VEHICLE | int | 100 | The device is in a vehicle, such as a car. |
+| BIKE | int | 101 | The device is on a bicycle. |
+| FOOT | int | 102 | The device user is walking or running. |
+| STILL | int | 103 | The device is still. |
+| OTHERS | int | 104 | The current activity cannot be detected. |
+| TILTING | int | 105 | The device has an obvious tilt change. |
+| WALKING | int | 107 | The user of the device is walking,it is a sub-activity of FOOT. |
+| RUNNING | int | 108 | The user of the device is running,it is a sub-activity of FOOT. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-----------------------------------------------------------------|----------------------|
+| ActivityIdentificationData({int identificationActivity, int possibility}) | Default constructor. |
+| ActivityIdentificationData.fromMap(Map\ map) | Creates a ActivityIdentificationData object from a map. |
+| ActivityIdentificationData.fromJson(String source) | Creates a ActivityIdentificationData object from a JSON string. |
+
+#### Public Method Summary
+
+| Methods | Return Type | Description |
+|------------------------------|-------------|----------------------------------------------------------------|
+| static isValidType(int type) | bool | Checks that given activity type is one of the valid constants. |
+
+#### Public Constructors
+
+##### ActivityIdentificationData({int identificationActivity, int possibility})
+
+Constructor for ActivityIdentificationData object.
+
+| Parameter | Type | Description |
+|------------------------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
+| identificationActivity | int | Type of the detected activity. |
+| possibility | int | The confidence for the user to execute the activity. The confidence ranges from 0 to 100. A larger value indicates more reliable activity authenticity. |
+
+##### ActivityIdentificationData.fromMap(Map\ map)
+
+Creates a ActivityIdentificationData object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### ActivityIdentificationData.fromJson(String source)
+
+Creates a ActivityIdentificationData object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+#### Public Methods
+
+##### bool isValidType
+
+Checks whether the specified activity type is a valid constant.
+
+| Return Type | Description |
+|-----------------|-------------|
+| bool | true if the specified activity type is a valid constant; false otherwise. |
+
+### ActivityIdentificationResponse
+
+Activity identification result.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|-----------------------------|------------------------------------|-----------------------------------------------------------------------------------------------------------------|
+| time | int | Time of this identification, which is in milliseconds since January 1, 1970. |
+| elapsedTimeFromReboot | int | Elapsed real time (in milliseconds) of this identification since boot. |
+| activityIdentificationDatas | List\ | List of activitiy identification list. The activity identifications are sorted by most probable activity first. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|---------------------------------------------------------------------------------------------------------------------------------------|----------------------|
+| ActivityIdentificationResponse({int time, int elapsedTimeFromReboot, List\ activityIdentificationDatas}) | Default constructor. |
+| ActivityIdentificationResponse.fromMap(Map\ map) | Creates a ActivityIdentificationResponse object from a map. |
+| ActivityIdentificationResponse.fromJson(String source) | Creates a ActivityIdentificationResponse object from a JSON string. |
+
+#### Public Method Summary
+
+| Methods | Return Type | Description |
+|------------------------------------------|----------------------------|-----------------------------------------------------------------------------------|
+| mostActivityIdentification | ActivityIdentificationData | This API is used to obtain the most probable activity identification of the user. |
+| getActivityPossibility(int activityType) | int | This API is used to obtain the confidence of an activity type. |
+
+#### Public Constructors
+
+##### ActivityIdentificationResponse({int time, int elapsedTimeFromReboot, List\ activityIdentificationDatas})
+
+Constructor for ActivityIdentificationResponse object.
+
+| Parameter | Type | Description |
+|-----------------------------|------------------------------------|-----------------------------------------------------------------------------------------------------------------|
+| time | int | Time of this identification, which is in milliseconds since January 1, 1970. |
+| elapsedTimeFromReboot | int | Elapsed real time (in milliseconds) of this identification since boot. |
+| activityIdentificationDatas | List\ | List of activitiy identification list. The activity identifications are sorted by most probable activity first. |
+
+##### ActivityIdentificationResponse.fromMap(Map\ map)
+
+Creates a ActivityIdentificationResponse object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### ActivityIdentificationResponse.fromJson(String source)
+
+Creates a Location object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+#### Public Methods
+
+##### ActivityIdentificationData mostActivityIdentification
+
+Obtains the most possible activity of a user.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| ActivityIdentificationData | Identified activity. |
+
+##### int getActivityPossibility
+
+Obtains the confidence of an activity type.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| activityType | Activity type. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| int | Confidence of the activity type. |
+
+### Geofence Service
+
+Interaction access point of geofence.
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|----------------------------------------|----------------------|
+| GeofenceService() | Default constructor. |
+
+#### Public Method Summary
+
+| Return Type | Method | Description |
+|------------------------|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
+| Future\ | createGeofenceList(GeofenceRequest geofenceRequest) | This API is used to add geofences. When a geofence is triggered, a notification can be listened through **onGeofenceData** API method. |
+| Future\ | deleteGeofenceList(int requestCode) | This API is used to remove geofences associated with a **requestCode**. |
+| Future\ | deleteGeofenceListWithIds(List\ geofenceIds) | This API is used to remove geofences by their unique IDs. |
+| Stream\ | onGeofenceData | This API is used to listen geofence updates that comes from createGeofenceList API method. |
+
+#### Public Constructors
+
+##### GeofenceService()
+
+Constructor for GeofenceService object.
+
+#### Public Methods
+
+##### Future\ createGeofenceList(GeofenceRequest geofenceRequest) *async*
+
+Adds geofences. When a geofence is triggered, the onGeofenceData method can listen for a notification.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| geofenceRequest | Geofence request object. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Request code if the operation is successful; PlatformException otherwise. The request code can be used to call the deleteGeofenceList method. |
+
+##### Future\ deleteGeofenceList(int requestCode) *async*
+
+Removes geofences associated with a request code.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| requestCode | Request code returned by the createGeofenceList method. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Future\ deleteGeofenceListWithIds(List\ geofenceIds) *async*
+
+Removes geofences by their unique IDs.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| geofenceIds | Unique IDs of geofences to be removed. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | No return value if the operation is successful; PlatformException otherwise. |
+
+##### Stream\ onGeofenceData
+
+Listens for geofence updates that come from the createGeofenceList method.
+
+| Parameter | Description |
+|-------------------------|-------------|
+| geofenceIds | Unique IDs of geofences to be removed. |
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Stream\ | Stream of GeofenceData object. You can call the .listen() method to subscribe to this stream and listen for updates. |
+
+### Geofence
+
+Class that contains information about geofences.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|----------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| uniqueId | String | Unique ID. If the unique ID already exists, the new geofence will overwrite the old one. |
+| conversions | int | Geofence conversions. The bitwise-OR operation is supported. |
+| validDuration | int | Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time. |
+| latitude | double | Latitude. The value range is [-90,90]. |
+| longitude | double | Longitude. The value range is [-180,180]. |
+| radius | double | Radius, in meters. |
+| notificationInterval | int | Notification response capability. The default value is **0**. Setting it to a larger value can reduce power consumption accordingly. However, reporting of geofence events may be delayed. |
+| dwellDelayTime | int | Lingering duration for converting a geofence event, in milliseconds. A geofence event is converted when a user lingers in a geofence for this amount of time. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|---------------------------|------|-------|-----------------------------------------------------|
+| ENTER_GEOFENCE_CONVERSION | int | 1 | A user enters the geofence. |
+| EXIT_GEOFENCE_CONVERSION | int | 2 | A user exits the geofence. |
+| DWELL_GEOFENCE_CONVERSION | int | 4 | A user lingers in the geofence. |
+| GEOFENCE_NEVER_EXPIRE | int | -1 | No timeout interval is configured for the geofence. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
+| Geofence({String uniqueId, int conversions, int validDuration, double latitude, double longitude, double radius, int notificationInterval, int dwellDelayTime}) | Default constructor. |
+| Geofence.fromMap(Map\ map) | Creates a Geofence object from a map. |
+| Geofence.fromJson(String source) | Creates a Geofence object from a JSON string. |
+
+### Public Constructors
+
+##### Geofence({String uniqueId, int conversions, int validDuration, double latitude, double longitude, double radius, int notificationInterval, int dwellDelayTime})
+
+Constructor for Geofence object.
+
+| Parameter | Type | Description |
+|----------------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| uniqueId | String | Unique ID. If the unique ID already exists, the new geofence will overwrite the old one. |
+| conversions | int | Geofence conversions. The bitwise-OR operation is supported. |
+| validDuration | int | Geofence timeout interval, in milliseconds. The geofence will be automatically deleted after this amount of time. |
+| latitude | double | Latitude. The value range is [-90,90]. |
+| longitude | double | Longitude. The value range is [-180,180]. |
+| radius | double | Radius, in meters. |
+| notificationInterval | int | Notification response capability. The default value is **0**. Setting it to a larger value can reduce power consumption accordingly. However, reporting of geofence events may be delayed. |
+| dwellDelayTime | int | Lingering duration for converting a geofence event, in milliseconds. A geofence event is converted when a user lingers in a geofence for this amount of time. |
+
+##### Geofence.fromMap(Map\ map)
+
+Creates a Geofence object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### Geofence.fromJson(String source)
+
+Creates a Geofence object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### GeofenceData
+
+Geofence event.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|--------------------------|----------------|--------------------------------------------|
+| errorCode | int | Error code. |
+| conversion | int | Geofence convert type. |
+| convertingGeofenceIdList | List\ | List of converted geofence unique IDs. |
+| convertingLocation | Location | The location when a geofence is converted. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-------------------------------------------------------------------------------------------------------------------|----------------------|
+| GeofenceData({int errorCode, int conversion, List convertingGeofenceIdList, Location convertingLocation}) | Default constructor. |
+| GeofenceData.fromMap(Map\ map) | Creates a GeofenceData object from a map. |
+| GeofenceData.fromJson(String source) | Creates a GeofenceData object from a JSON string. |
+
+#### Public Constructors
+
+##### GeofenceData({int errorCode, int conversion, List convertingGeofenceIdList, Location convertingLocation})
+
+Constructor for GeofenceData object.
+
+| Properties | Type | Description |
+|--------------------------|----------------|--------------------------------------------|
+| errorCode | int | Error code. |
+| conversion | int | Geofence convert type. |
+| convertingGeofenceIdList | List\ | List of converted geofence unique IDs. |
+| convertingLocation | Location | The location when a geofence is converted. |
+
+##### GeofenceData.fromMap(Map\ map)
+
+Creates a GeofenceData object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### GeofenceData.fromJson(String source)
+
+Creates a GeofenceData object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### GeofenceRequest
+
+Geofence request class.
+
+#### Public Properties
+
+| Properties | Type | Description |
+|-----------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| geofenceList | List\ | List of geofences to be monitored. |
+| initConversions | int | Initial conversion type. This parameter is invalid if it is set to 0. The default value is GeofenceRequest.ENTER_INIT_CONVERSION | GeofenceRequest.DWELL_INIT_CONVERSION. |
+| coordinateType | int | Coordinate type of geofences. Defaults to GeofenceRequest.COORDINATE_TYPE_WGS_84. |
+
+#### Public Constants
+
+| Constants | Type | Value | Description |
+|------------------------|------|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| ENTER_INIT_CONVERSION | int | 1 | ENTER_INIT_CONVERSION is converted immediately when a request is initiated to add the geofence where a user device has already entered. |
+| EXIT_INIT_CONVERSION | int | 2 | EXIT_INIT_CONVERSION is converted immediately when a request is initiated to add the geofence where a user device has already exit. |
+| DWELL_INIT_CONVERSION | int | 4 | DWELL_INIT_CONVERSION is converted immediately when a request is initiated to add the geofence where a user device has already entered and stayed for the specified duration. |
+| COORDINATE_TYPE_WGS_84 | int | 1 | WGS_84 coordinate system. |
+| COORDINATE_TYPE_GCJ_02 | int | 0 | GCJ-02 coordinate system. |
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|-------------------------------------------------------------------------------------------|----------------------|
+| GeofenceRequest({List\ geofenceList, int initConversions, int coordinateType}) | Default constructor. |
+| GeofenceRequest.fromMap(Map\ map) | Creates a GeofenceRequest object from a map. |
+| GeofenceRequest.fromJson(String source) | Creates a GeofenceRequest object from a JSON string. |
+
+#### Public Constructors
+
+##### GeofenceRequest({List\ geofenceList, int initConversions, int coordinateType})
+
+Constructor for GeofenceRequest object.
+
+| Properties | Type | Description |
+|-----------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| geofenceList | List\ | List of geofences to be monitored. |
+| initConversions | int | Initial conversion type. This parameter is invalid if it is set to 0. The default value is GeofenceRequest.ENTER_INIT_CONVERSION | GeofenceRequest.DWELL_INIT_CONVERSION. |
+| coordinateType | int | Coordinate type of geofences. Defaults to GeofenceRequest.COORDINATE_TYPE_WGS_84. |
+
+##### GeofenceRequest.fromMap(Map\ map)
+
+Creates a GeofenceRequest object from a map.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| map | Map\| Map as a source. |
+
+##### GeofenceRequest.fromJson(String source)
+
+Creates a GeofenceRequest object from a JSON string.
+
+| Parameter | Type | Description |
+|------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------|
+| source | String | JSON string as a source. |
+
+### PermissionHandler
+
+Checks or requests required permissions.
+
+#### Public Constructor Summary
+
+| Constructor | Description |
+|------------------------------------------------|----------------------|
+| PermissionHandler() | Default constructor. |
+
+#### Public Method Summary
+
+| Return Type | Method | Description |
+|----------------|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| Future\ | hasLocationPermission() | This API is used to check location permission is available or not. |
+| Future\ | hasBackgroundLocationPermission() | This API is used to check background location permission is available or not. |
+| Future\ | hasActivityRecognitionPermission() | This API is used to check activity permission is available or not. |
+| Future\ | requestLocationPermission() | This API is used to request location permission. Returns true if permission is granted, else returns false. |
+| Future\ | requestBackgroundLocationPermission() | This API is used to request background location permission. Returns true if permission is granted, else returns false. |
+| Future\ | requestActivityRecognitionPermission() | This API is used to request activity recognition permission. Returns true if permission is granted, else returns false. |
+
+#### Public Constructors
+
+##### PermissionHandler()
+
+Constructor for PermissionHandler object.
+
+#### Public Methods
+
+##### Future\ hasLocationPermission() *async*
+
+Checks whether the location permission is available.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+##### Future\ hasBackgroundLocationPermission() *async*
+
+Checks whether the background location permission is available.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+##### Future\ hasActivityRecognitionPermission() *async*
+
+Checks whether the activity permission is available.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+##### Future\ requestLocationPermission() *async*
+
+Requests the location permission. The value true is returned if the permission is granted. Otherwise, false is returned.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+##### Future\ requestBackgroundLocationPermission() *async*
+
+Requests the background location permission. The value true is returned if the permission is granted. Otherwise, false is returned
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+##### Future\ requestActivityRecognitionPermission() *async*
+
+Requests the activity permission. The value true is returned if the permission is granted. Otherwise, false is returned.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | true or false if the operation is successful; PlatformException otherwise. |
+
+### HMSLogger
+
+#### Public Method Summary
+
+| Return Type | Method | Description |
+|----------------|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
+| Future\ | enableLogger() | This method enables the HMSLogger capability which is used for sending usage analytics of Location SDK's methods to improve the service quality.. |
+| Future\ | disableLogger() | This method disables the HMSLogger capability which is used for sending usage analytics of Location SDK's methods to improve the service quality. |
+
+#### Public Methods
+
+##### Future\ enableLogger() *async*
+
+This method enables the HMSLogger capability which is used for sending usage analytics of Location SDK's methods to improve the service quality. HMSLogger is enabled by default, it can be disabled with the disableLogger method.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Future result of an execution that returns no value. |
+
+##### Future\ disableLogger() *async*
+
+This method disables the HMSLogger capability which is used for sending usage analytics of Location SDK's methods to improve the service quality.
+
+| Return Type | Description |
+|----------------------------------|-------------|
+| Future\ | Future result of an execution that returns no value. |
+
+
+## Configuration 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](https://developer.android.com/studio/build/shrink-code).
+
+**/android/app/proguard-rules. pro**
+
+```
+-ignorewarnings
+-keepattributes *Annotation*
+-keepattributes Exceptions
+-keepattributes InnerClasses
+-keepattributes Signature
+-keepattributes SourceFile,LineNumberTable
+-keep class com.hianalytics.android.**{*;}
+-keep class com.huawei.updatesdk.**{*;}
+-keep class com.huawei.hms.**{*;}
+
+```
+
+**/android/app/build.gradle**
+
+```gradle
+buildTypes {
+ debug {
+ signingConfig signingConfigs.config
+ }
+ release {
+
+ // 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'
+
+ signingConfig signingConfigs.config
+ }
+}
+```
+
+
+## Sample Project
+This plugin includes a demo project in the **example** folder, there you can find more usage examples.
+
+
+
+## Questions or Issues
+
+If you have questions about how to use HMS samples, try the following options:
+
+- [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services) is the best place for any programming questions. Be sure to tag your question with **huawei-mobile-services**.
+- [Github](https://github.com/HMS-Core/hms-flutter-plugin) is the official repository for these plugins, You can open an issue or submit your ideas.
+- [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001) HMS Core Module is great for general questions, or seeking recommendations and opinions.
+- [Huawei Developer Docs](https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin) 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.
+
+
+## Licensing and Terms
+
+Huawei Location Kit Flutter Plugin uses the Apache 2.0 license.
\ No newline at end of file
diff --git a/hms-plugins/flutter-hms-location/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/hms-plugins/flutter-hms-location/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
new file mode 100644
index 00000000..975e9019
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
@@ -0,0 +1,25 @@
+package io.flutter.plugins;
+
+import io.flutter.plugin.common.PluginRegistry;
+import com.huawei.hms.flutter.location.LocationPlugin;
+
+/**
+ * Generated file. Do not edit.
+ */
+public final class GeneratedPluginRegistrant {
+ public static void registerWith(PluginRegistry registry) {
+ if (alreadyRegisteredWith(registry)) {
+ return;
+ }
+ LocationPlugin.registerWith(registry.registrarFor("com.huawei.hms.flutter.location.LocationPlugin"));
+ }
+
+ private static boolean alreadyRegisteredWith(PluginRegistry registry) {
+ final String key = GeneratedPluginRegistrant.class.getCanonicalName();
+ if (registry.hasPlugin(key)) {
+ return true;
+ }
+ registry.registrarFor(key);
+ return false;
+ }
+}
diff --git a/hms-plugins/flutter-hms-location/android/build.gradle b/hms-plugins/flutter-hms-location/android/build.gradle
new file mode 100644
index 00000000..228af211
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/build.gradle
@@ -0,0 +1,45 @@
+group 'com.huawei.hms.flutter.location'
+version '1.0'
+
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ maven { url 'https://developer.huawei.com/repo/' }
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.6.0'
+ }
+}
+
+rootProject.allprojects {
+ repositories {
+ google()
+ jcenter()
+ maven { url 'https://developer.huawei.com/repo/' }
+ }
+}
+
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.3"
+
+ defaultConfig {
+ minSdkVersion 19
+ targetSdkVersion 29
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ lintOptions {
+ disable 'InvalidPackage'
+ }
+}
+
+dependencies {
+ implementation 'com.huawei.hms:location:5.0.0.301'
+}
diff --git a/hms-plugins/flutter-hms-location/android/gradle.properties b/hms-plugins/flutter-hms-location/android/gradle.properties
new file mode 100644
index 00000000..38c8d454
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/gradle.properties
@@ -0,0 +1,4 @@
+org.gradle.jvmargs=-Xmx1536M
+android.enableR8=true
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/hms-plugins/flutter-hms-location/android/gradle/wrapper/gradle-wrapper.properties b/hms-plugins/flutter-hms-location/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..a4b44297
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/hms-plugins/flutter-hms-location/android/gradlew b/hms-plugins/flutter-hms-location/android/gradlew
new file mode 100644
index 00000000..2fe81a7d
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/gradlew
@@ -0,0 +1,183 @@
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/hms-plugins/flutter-hms-location/android/gradlew.bat b/hms-plugins/flutter-hms-location/android/gradlew.bat
new file mode 100644
index 00000000..62bd9b9c
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/gradlew.bat
@@ -0,0 +1,103 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/hms-plugins/flutter-hms-location/android/local.properties b/hms-plugins/flutter-hms-location/android/local.properties
new file mode 100644
index 00000000..c6cb6fc0
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/local.properties
@@ -0,0 +1,2 @@
+sdk.dir=C:\\Users\\sultan.khan\\AppData\\Local\\Android\\Sdk
+flutter.sdk=C:\\Program Files\\flutter
\ No newline at end of file
diff --git a/hms-plugins/flutter-hms-location/android/settings.gradle b/hms-plugins/flutter-hms-location/android/settings.gradle
new file mode 100644
index 00000000..2a0347f0
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'huawei_location'
diff --git a/hms-plugins/flutter-hms-location/android/src/main/AndroidManifest.xml b/hms-plugins/flutter-hms-location/android/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..d54dab86
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/LocationPlugin.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/LocationPlugin.java
new file mode 100644
index 00000000..4e98a26d
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/LocationPlugin.java
@@ -0,0 +1,201 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location;
+
+import android.app.Activity;
+import android.content.Context;
+
+import androidx.annotation.NonNull;
+
+import com.huawei.hms.flutter.location.constants.Channel;
+import com.huawei.hms.flutter.location.handlers.ActivityConversionStreamHandler;
+import com.huawei.hms.flutter.location.handlers.ActivityIdentificationMethodHandler;
+import com.huawei.hms.flutter.location.handlers.ActivityIdentificationStreamHandler;
+import com.huawei.hms.flutter.location.handlers.FusedLocationMethodHandler;
+import com.huawei.hms.flutter.location.handlers.FusedLocationStreamHandler;
+import com.huawei.hms.flutter.location.handlers.GeofenceMethodHandler;
+import com.huawei.hms.flutter.location.handlers.GeofenceStreamHandler;
+import com.huawei.hms.flutter.location.handlers.HMSLoggerMethodHandler;
+import com.huawei.hms.flutter.location.handlers.PermissionHandler;
+
+import io.flutter.embedding.engine.plugins.FlutterPlugin;
+import io.flutter.embedding.engine.plugins.activity.ActivityAware;
+import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
+import io.flutter.plugin.common.BinaryMessenger;
+import io.flutter.plugin.common.EventChannel;
+import io.flutter.plugin.common.MethodChannel;
+import io.flutter.plugin.common.PluginRegistry.Registrar;
+
+public class LocationPlugin implements FlutterPlugin, ActivityAware {
+ private MethodChannel permissionMethodChannel;
+ private MethodChannel fusedLocationMethodChannel;
+ private MethodChannel geofenceMethodChannel;
+ private MethodChannel activityIdentificationMethodChannel;
+ private MethodChannel locationEnhanceMethodChannel;
+ private MethodChannel hmsLoggerMethodChannel;
+ private EventChannel mFusedLocationEventChannel;
+ private EventChannel mGeofenceEventChannel;
+ private EventChannel mActivityIdentificationEventChannel;
+ private EventChannel mActivityConversionEventChannel;
+ private PermissionHandler permissionHandler;
+ private EventChannel.StreamHandler mFusedLocationStreamHandler;
+ private EventChannel.StreamHandler mGeofenceStreamHandler;
+ private EventChannel.StreamHandler mActivityIdentificationStreamHandler;
+ private EventChannel.StreamHandler mActivityConversionStreamHandler;
+ private FusedLocationMethodHandler fusedLocationMethodHandler;
+ private GeofenceMethodHandler geofenceMethodHandler;
+ private ActivityIdentificationMethodHandler activityIdentificationMethodHandler;
+ private HMSLoggerMethodHandler hmsLoggerMethodHandler;
+
+ public static void registerWith(final Registrar registrar) {
+ final LocationPlugin instance = new LocationPlugin();
+ final Activity activity = registrar.activity();
+ final Context context = activity.getApplicationContext();
+ final BinaryMessenger messenger = registrar.messenger();
+
+ instance.onAttachedToEngine(context, messenger);
+ instance.permissionHandler = new PermissionHandler(activity);
+ instance.permissionMethodChannel.setMethodCallHandler(instance.permissionHandler);
+ instance.fusedLocationMethodHandler = new FusedLocationMethodHandler(activity,
+ instance.fusedLocationMethodChannel);
+ instance.fusedLocationMethodChannel.setMethodCallHandler(instance.fusedLocationMethodHandler);
+ instance.geofenceMethodHandler = new GeofenceMethodHandler(activity);
+ instance.geofenceMethodChannel.setMethodCallHandler(instance.geofenceMethodHandler);
+ instance.activityIdentificationMethodHandler = new ActivityIdentificationMethodHandler(activity);
+ instance.activityIdentificationMethodChannel.setMethodCallHandler(instance.activityIdentificationMethodHandler);
+ instance.hmsLoggerMethodHandler = new HMSLoggerMethodHandler(context);
+ instance.hmsLoggerMethodChannel.setMethodCallHandler(instance.hmsLoggerMethodHandler);
+ registrar.addRequestPermissionsResultListener(instance.permissionHandler);
+ registrar.addActivityResultListener(instance.fusedLocationMethodHandler);
+ }
+
+ private void initChannels(final BinaryMessenger messenger) {
+ permissionMethodChannel = new MethodChannel(messenger, Channel.PERMISSON_METHOD.id());
+ fusedLocationMethodChannel = new MethodChannel(messenger, Channel.FUSED_LOCATION_METHOD.id());
+ geofenceMethodChannel = new MethodChannel(messenger, Channel.GEOFENCE_METHOD.id());
+ activityIdentificationMethodChannel = new MethodChannel(messenger, Channel.ACTIVITY_IDENTIFICATION_METHOD.id());
+ locationEnhanceMethodChannel = new MethodChannel(messenger, Channel.LOCATION_ENHANCE_METHOD.id());
+ hmsLoggerMethodChannel = new MethodChannel(messenger, Channel.HMSLOGGER_METHOD.id());
+ mFusedLocationEventChannel = new EventChannel(messenger, Channel.FUSED_LOCATION_EVENT.id());
+ mGeofenceEventChannel = new EventChannel(messenger, Channel.GEOFENCE_EVENT.id());
+ mActivityIdentificationEventChannel = new EventChannel(messenger, Channel.ACTIVITY_IDENTIFICATION_EVENT.id());
+ mActivityConversionEventChannel = new EventChannel(messenger, Channel.ACTIVITY_CONVERSION_EVENT.id());
+ }
+
+ private void initStreamHandlers(final Context context) {
+ mFusedLocationStreamHandler = new FusedLocationStreamHandler(context);
+ mGeofenceStreamHandler = new GeofenceStreamHandler(context);
+ mActivityIdentificationStreamHandler = new ActivityIdentificationStreamHandler(context);
+ mActivityConversionStreamHandler = new ActivityConversionStreamHandler(context);
+ }
+
+ private void setStreamHandlers() {
+ mFusedLocationEventChannel.setStreamHandler(mFusedLocationStreamHandler);
+ mGeofenceEventChannel.setStreamHandler(mGeofenceStreamHandler);
+ mActivityIdentificationEventChannel.setStreamHandler(mActivityIdentificationStreamHandler);
+ mActivityConversionEventChannel.setStreamHandler(mActivityConversionStreamHandler);
+ }
+
+ private void resetStreamHandlers() {
+ mFusedLocationEventChannel.setStreamHandler(null);
+ mGeofenceEventChannel.setStreamHandler(null);
+ mActivityIdentificationEventChannel.setStreamHandler(null);
+ mActivityConversionEventChannel.setStreamHandler(null);
+ }
+
+ private void removeStreamHandlers() {
+ mFusedLocationStreamHandler = null;
+ mGeofenceStreamHandler = null;
+ mActivityIdentificationStreamHandler = null;
+ mActivityConversionStreamHandler = null;
+ }
+
+ private void removeChannels() {
+ permissionMethodChannel = null;
+ fusedLocationMethodChannel = null;
+ geofenceMethodChannel = null;
+ activityIdentificationMethodChannel = null;
+ locationEnhanceMethodChannel = null;
+ hmsLoggerMethodChannel = null;
+ mFusedLocationEventChannel = null;
+ mGeofenceEventChannel = null;
+ mActivityIdentificationEventChannel = null;
+ mActivityConversionEventChannel = null;
+ }
+
+ private void onAttachedToEngine(final Context context, final BinaryMessenger messenger) {
+ initChannels(messenger);
+ initStreamHandlers(context);
+ setStreamHandlers();
+ }
+
+ @Override
+ public void onAttachedToEngine(@NonNull final FlutterPluginBinding binding) {
+ onAttachedToEngine(binding.getApplicationContext(), binding.getBinaryMessenger());
+ }
+
+ @Override
+ public void onDetachedFromEngine(@NonNull final FlutterPluginBinding binding) {
+ resetStreamHandlers();
+ removeStreamHandlers();
+ removeChannels();
+ }
+
+ @Override
+ public void onAttachedToActivity(@NonNull final ActivityPluginBinding binding) {
+ final Activity activity = binding.getActivity();
+
+ permissionHandler = new PermissionHandler(activity);
+ fusedLocationMethodHandler = new FusedLocationMethodHandler(activity, fusedLocationMethodChannel);
+ geofenceMethodHandler = new GeofenceMethodHandler(activity);
+ activityIdentificationMethodHandler = new ActivityIdentificationMethodHandler(activity);
+ hmsLoggerMethodHandler = new HMSLoggerMethodHandler(activity.getApplicationContext());
+
+ binding.addRequestPermissionsResultListener(permissionHandler);
+ binding.addActivityResultListener(fusedLocationMethodHandler);
+
+ permissionMethodChannel.setMethodCallHandler(permissionHandler);
+ fusedLocationMethodChannel.setMethodCallHandler(fusedLocationMethodHandler);
+ geofenceMethodChannel.setMethodCallHandler(geofenceMethodHandler);
+ activityIdentificationMethodChannel.setMethodCallHandler(activityIdentificationMethodHandler);
+ hmsLoggerMethodChannel.setMethodCallHandler(hmsLoggerMethodHandler);
+ }
+
+ @Override
+ public void onDetachedFromActivityForConfigChanges() {
+ onDetachedFromActivity();
+ }
+
+ @Override
+ public void onReattachedToActivityForConfigChanges(@NonNull final ActivityPluginBinding binding) {
+ onAttachedToActivity(binding);
+ }
+
+ @Override
+ public void onDetachedFromActivity() {
+ activityIdentificationMethodChannel.setMethodCallHandler(null);
+ geofenceMethodChannel.setMethodCallHandler(null);
+ fusedLocationMethodChannel.setMethodCallHandler(null);
+ locationEnhanceMethodChannel.setMethodCallHandler(null);
+ hmsLoggerMethodChannel.setMethodCallHandler(null);
+ activityIdentificationMethodHandler = null;
+ geofenceMethodHandler = null;
+ fusedLocationMethodHandler = null;
+ permissionHandler = null;
+ hmsLoggerMethodHandler = null;
+ }
+}
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Action.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Action.java
new file mode 100644
index 00000000..9a83e743
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Action.java
@@ -0,0 +1,24 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location.constants;
+
+public interface Action {
+ String PROCESS_LOCATION = "com.huawei.hms.flutter.location.ACTION_PROCESS_LOCATION";
+ String PROCESS_GEOFENCE = "com.huawei.hms.flutter.location.ACTION_PROCESS_GEOFENCE";
+ String PROCESS_CONVERSION = "com.huawei.hms.flutter.location.ACTION_PROCESS_CONVERSION";
+ String PROCESS_IDENTIFICATION = "com.huawei.hms.flutter.location.ACTION_PROCESS_IDENTIFICATION";
+}
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Channel.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Channel.java
new file mode 100644
index 00000000..3e21a60f
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Channel.java
@@ -0,0 +1,40 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location.constants;
+
+public enum Channel {
+ PERMISSON_METHOD("com.huawei.flutter.location/permission_methodchannel"),
+ FUSED_LOCATION_METHOD("com.huawei.flutter.location/fusedlocation_methodchannel"),
+ FUSED_LOCATION_EVENT("com.huawei.flutter.location/fusedlocation_eventchannel"),
+ GEOFENCE_METHOD("com.huawei.flutter.location/geofence_methodchannel"),
+ GEOFENCE_EVENT("com.huawei.flutter.location/geofence_eventchannel"),
+ ACTIVITY_IDENTIFICATION_METHOD("com.huawei.flutter.location/activityidentification_methodchannel"),
+ ACTIVITY_IDENTIFICATION_EVENT("com.huawei.flutter.location/activityidentification_eventchannel"),
+ ACTIVITY_CONVERSION_EVENT("com.huawei.flutter.location/activityconversion_eventchannel"),
+ LOCATION_ENHANCE_METHOD("com.huawei.flutter.location/locationenhance_methodchannel"),
+ HMSLOGGER_METHOD("com.huawei.flutter.location/hmslogger_methodchannel");
+
+ private final String id;
+
+ Channel(final String id) {
+ this.id = id;
+ }
+
+ public String id() {
+ return id;
+ }
+}
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Error.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Error.java
new file mode 100644
index 00000000..35f42ea8
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/constants/Error.java
@@ -0,0 +1,33 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location.constants;
+
+public enum Error {
+ LOCATION_SETTINGS_NOT_AVAILABLE("Unable to get location settings"),
+ NON_EXISTING_REQUEST_ID("Request ID does not exists"),
+ SEND_INTENT_EXCEPTION("Unable to send intent");
+
+ private final String message;
+
+ Error(final String message) {
+ this.message = message;
+ }
+
+ public String message() {
+ return message;
+ }
+}
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityConversionStreamHandler.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityConversionStreamHandler.java
new file mode 100644
index 00000000..f761e0ca
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityConversionStreamHandler.java
@@ -0,0 +1,53 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location.handlers;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.IntentFilter;
+
+import com.huawei.hms.flutter.location.constants.Action;
+import com.huawei.hms.flutter.location.logger.HMSLogger;
+import com.huawei.hms.flutter.location.receivers.ActivityConversionBroadcastReceiver;
+
+import io.flutter.plugin.common.EventChannel.EventSink;
+import io.flutter.plugin.common.EventChannel.StreamHandler;
+
+public class ActivityConversionStreamHandler implements StreamHandler {
+ private final Context context;
+ private BroadcastReceiver broadcastReceiver;
+
+ public ActivityConversionStreamHandler(final Context context) {
+ this.context = context;
+ }
+
+ @Override
+ public void onListen(final Object arguments, final EventSink events) {
+ broadcastReceiver = new ActivityConversionBroadcastReceiver(events);
+ context.registerReceiver(broadcastReceiver, new IntentFilter(Action.PROCESS_CONVERSION));
+
+ HMSLogger.getInstance(context).sendSingleEvent("ActivityConversionStreamHandler.onListen");
+ }
+
+ @Override
+ public void onCancel(final Object arguments) {
+ context.unregisterReceiver(broadcastReceiver);
+ broadcastReceiver = null;
+
+ HMSLogger.getInstance(context).sendSingleEvent("ActivityConversionStreamHandler.onCancel");
+ }
+}
diff --git a/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityIdentificationMethodHandler.java b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityIdentificationMethodHandler.java
new file mode 100644
index 00000000..ab502248
--- /dev/null
+++ b/hms-plugins/flutter-hms-location/android/src/main/java/com/huawei/hms/flutter/location/handlers/ActivityIdentificationMethodHandler.java
@@ -0,0 +1,141 @@
+/*
+ Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package com.huawei.hms.flutter.location.handlers;
+
+import android.app.Activity;
+import android.app.PendingIntent;
+import android.content.Intent;
+
+import androidx.annotation.NonNull;
+import androidx.core.util.Pair;
+
+import com.huawei.hms.flutter.location.constants.Action;
+import com.huawei.hms.flutter.location.constants.Error;
+import com.huawei.hms.flutter.location.listeners.DefaultFailureListener;
+import com.huawei.hms.flutter.location.listeners.RemoveUpdatesSuccessListener;
+import com.huawei.hms.flutter.location.listeners.RequestUpdatesFailureListener;
+import com.huawei.hms.flutter.location.listeners.RequestUpdatesSuccessListener;
+import com.huawei.hms.flutter.location.logger.HMSLogger;
+import com.huawei.hms.flutter.location.utils.ActivityUtils;
+import com.huawei.hms.location.ActivityConversionRequest;
+import com.huawei.hms.location.ActivityIdentification;
+import com.huawei.hms.location.ActivityIdentificationService;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.flutter.plugin.common.MethodCall;
+import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
+import io.flutter.plugin.common.MethodChannel.Result;
+
+public class ActivityIdentificationMethodHandler implements MethodCallHandler {
+ private final Activity activity;
+ private final Map requests;
+ private final ActivityIdentificationService service;
+
+ private int requestCode = 0;
+
+ public ActivityIdentificationMethodHandler(final Activity activity) {
+ this.activity = activity;
+ service = ActivityIdentification.getService(activity);
+ requests = new HashMap<>();
+ }
+
+ private void createActivityIdentificationUpdates(final MethodCall call, final Result result) {
+ final Pair intentData = buildPendingIntent(Action.PROCESS_IDENTIFICATION);
+
+ service.createActivityIdentificationUpdates(call.arguments(), intentData.second)
+ .addOnSuccessListener(new RequestUpdatesSuccessListener(call.method, activity, result, intentData.first))
+ .addOnFailureListener(
+ new RequestUpdatesFailureListener<>(call.method, activity, result, intentData.first, requests));
+ }
+
+ private void createActivityConversionUpdates(final MethodCall call, final Result result) {
+ final List