Halil Özel

Nov 24, 2020

3 min read

Huawei Map Kit Integration

Hello everyone, Today we will learn Huawei Map Kit.

What is Huawei Map Kit?

Huawei Map Kit

Map Kit is an SDK for map development. It covers map data of more than 200 countries and regions, and supports hundreds of languages. With this SDK, you can easily integrate map-based functions into your apps.

HUAWEI 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, and Points of Interest (POIs). Map interaction: Controls the interaction gestures and buttons on the map. Map drawing: Adds location markers, map layers, overlays, and various shapes.

For more :

How to use Huawei Map Kit?

Huawei Developer
  • First, you need to register a Huawei Developer account. You can register it for free from the link below.
  • After opening the developer account, we will create a project
Huawei AppGallery
  • And open an application in the project.
Huawei Map App
  • We need to adjust the settings of the application. Since it is a sample project, I share all the information with you.
Huawei Map Kit Settings
  • We need to produce SHA-256 certificate fingerprints. We click on the Gradle area on the right in Android Studio.
Gradle signReport
  • Clicking the signingReport button under Tasks, we generate SHA 256 code. We add it to the relevant field in the project settings.
Android KeyStore
  • We need to activate MapKit from the Manage API section.
Huawei Manage API
  • We download the agconnect-services.json file. Then we add it to the app folder of our project.
agconnect-services.json
  • We define the necessary permissions in the Android Manifest file.
  • In the Build Gradle field, we add the necessary codes for Huawei Map Kit.
build.gradle
  • We add the plugin in Build Gradle.
build.gradle - plugins
  • We add the Map Kit dependency in Build Gradle.
build.gradle - dependency
  • Now we can add map to our layout file.
  • We make map settings in the MainActivity class. We add a static location information. We add a marker to the map.

We will test the application with Cloud Debugging. You can run the application by following the below document.

We have done ✅ all the necessary actions. Congratulations 🥳 You have developed the first Huawei Map 🗺 application.

Huawei Map Kit Sample

You can access the codes of the project from my GitHub account.

Recourses

  1. https://developer.huawei.com/consumer/en/hms/huawei-MapKit/
  2. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-sdk-introduction-0000001050158633
  3. https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/hms-map-v4-faq

Happy 😊 Coding 👨‍💻 👩‍💻