English | 中文
The Huawei location sample code encapsulates the Huawei location API. It provides a number of sample programs for your reference or use.
We also provide an example to demonstrate the use of the LocationKit SDK for HarmonyOS.
This example builds the system using Gradle.
First, demonstrate by cloning this code repository or downloading a zip package.
In DevEco Studio, use "Open an existing DevEco Studio project" and select the "harmony-location-demo" directory.
You can use the "gradlew signReleaseHap" command to build the project directly.
- Clone or download the project and open the downloaded folder in DevEco Studio.
- Use DevEco Studio to install the configured project on the device.
HMS Core (APK) 6.0.0 or later has been installed on the Huawei Smartwatch.
1.Invoke requestLocationUpdates of FusedLocationProviderClient to add a location request. Code location in src/main/java/com/huawei/sample/harmony/location/slice/RequestLocationCallbackAbilitySlice.java
If you are still evaluating HMS Core, obtain the latest information about HMS Core and share your insights with other developers at Reddit.
- To resolve development issues, please go to Stack Overflow. You can ask questions below the huawei-mobile-services tag, and Huawei R&D experts can solve your problem online on a one-to-one basis.
- To join the developer discussion, please visit Huawei Developer Forum.
If you have problems using the sample code, submit issues and pull requests to the repository.
harmony-location-demo is licensed under the Apache License, version 2.0.