We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
GuidesLocation KitAndroidGetting Started

Getting Started

NOTICE
  1. To use the high-precision location capability, you need to comply with relevant laws and regulations. In addition, you and Huawei need to apply to related departments in China together for the license for using the high-precision location deflection plugin.
  2. Currently, the high-precision location capability is available only in Shenzhen, Guangzhou, Suzhou, Hangzhou, Chongqing, Chengdu, Tianjin, and Dongguan in the Chinese mainland. More cities will be supported in the future.

Quick Tutorial

Before developing your app, you can follow instructions in the codelab to experience how to quickly integrate this kit into an app.

Development Environment

  • JDK version: 1.7 or later
  • Android Studio version: 3.6.1 or later

    • minSdkVersion: 22 or later
    • targetSdkVersion: 33 (recommended)
    • compileSdkVersion: 33 (recommended)
    • Gradle version: 5.4.1 or later (recommended)

    If you need to use multiple HMS Core kits, use the latest versions required for these kits.

  • Test device: a Huawei phone or tablet running EMUI 5.0 or later, or a non-Huawei phone running Android 5.1 or later

Development Process

Expand

No.

Step

Description

1

Configuring App Information in AppGallery Connect

Configure app information in AppGallery Connect, including Registering as a Developer, Creating an App, Generating a Signing Certificate Fingerprint, and Configuring the Signing Certificate Fingerprint.

2

Integrating the SDK

Integrate the HMS Core SDK into your app.

3

Configuring Obfuscation Scripts

Before building the APK, configure the obfuscation configuration file to prevent the HMS Core SDK from being obfuscated.

4

Developing the Fused Location Service

Integrate the fused location function into your app, so that your app can quickly obtain the precise location of a user.

Developing the Activity Identification Service

Integrate the activity identification function into your app. With this function, your app can identify user activity status through the acceleration sensor, cellular network information, magnetometer, and orientation sensor, helping you adapt your app to user behavior.

Developing the Geofence Service

Integrate the geofence function into your app. With this function, you can set an interested area through an API so that your app can receive a notification when a specified action (such as leaving, entering, or staying in the area) occurs.

Developing the High-precision Location Service

Integrate the high-precision location function into your app. With this function, your app can obtain the user device location accurate to within one meter using GNSS based on multiple high-precision location technologies such as Real-time Kinematic (RTK).

(Optional) Developing the Log Recording Service

Specify a fixed log directory where log files are stored for analysis and troubleshooting.

Developing the Indoor Location Service

Integrate the indoor location function into your app. With this function, your app can obtain precise indoor locations in time and identify the floor.

Developing the Coordinate Conversion Service

Convert WGS84 coordinates into GCJ02 coordinates.

5

App Release

Complete your app information in AppGallery Connect, and submit your app for release.

HMS Toolkit provides end-to-end tools (including those for app creation, free real-device debugging, and releasing) that you need to develop your own HMS Core-integrated app and release it, with lower costs and higher efficiency.

If you want to integrate Location Kit using HMS Toolkit, follow the instructions here.

Search in Guides
Enter a keyword.