HMS Core Map Kit Sample Code
English | δΈζ
Contents
Introduction
Map Kit allows you to customize your map display and the way for users to interact with your map, tailoring map use experience for your users. This can make location-based services in your app work better, empowering users to better use your app.
Map Kit uses the WGS 84 GPS coordinate system, which meets most map development requirements outside China, including:
- Map display: Displays buildings, roads, water systems, Points of Interest (POIs), and others.
- Map interaction: Controls the interaction gestures and buttons on the map.
- Map drawing: Adds location markers, map layers, overlays, various shapes, and others.
You can also use HMS Toolkit to quickly run the sample code. HMS Toolkit supports one-stop kit integration, and provides functions such as free app debugging on remote real devices. To learn more about HMS Toolkit, please refer to the HMS Toolkit documentation.
Preparations
The sample code is built using Gradle to demonstrate how to use the Map SDK for Android.
First, download the sample code by cloning this repository or downloading the compressed package.
In Android Studio, click Open an existing Android Studio project and select the directory where the map-sample file is located.
You can use the gradlew build command to directly build the project.
Then, you need to create an app in AppGallery Connect, obtain the agconnect-services.json file, and add it to the project. You also need to generate a signing certificate fingerprint, add the signing certificate file to the project, and add related configurations to the build.gradle file. For details, please refer to Configuring App Information in AppGallery Connect.
To learn more, refer to the following documents:
Environment Requirements
It is recommended that the Android SDK version be 19 or later, and the JDK version be 1.8 or later.
Result
Technical Support
You can visit the Reddit community to obtain the latest information about HMS Core and communicate with other developers.
If you have any questions about the sample code, try the following:
- Visit Stack Overflow, submit your questions, and tag them with huawei-mobile-services. Huawei experts will answer your questions.
- Visit the HMS Core section in the HUAWEI Developer Forum and communicate with other developers.
If you encounter any issues when using the sample code, submit your issues or submit a pull request.
License
The sample code is licensed under Apache License 2.0.