How to integrate Huawei HMS Map Kit and HMS Location Kit into the one project

Eray Mekik
Huawei Developers
Published in
3 min readJul 2, 2020

Dear All,

In this tutorial, I will show you how to integrate HMS Map Kit and HMS Location Kit into the one project.

Also, in this project, we’ll add a marker at specific locations and draw a circle at the current location of device on the map.

  • First of all, we need to do integration preparations. You must create app and update app information in AppGallery Connect, please visit below address to update your app information on your account.

https://developer.huawei.com/consumer

Also you can refer below document for the preparations.
https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html

  • After create and update your app in AppGallery Connect, let’s start to add Maven repository and dependencies on your app.
  • We need to add the root directory build.gradle at project gradle.
  • We need to add the plugin and dependencies to to build.gradle Module app(app gradle) for HMS Map Kit and HMS Location Kit.
  • Now we can add permissions to AndroidManifest.xml file.
  • Let’s start to define our layout
  • Before start to build “main activity” we can create “data model” class and we need to modify it as below.
  • Now we can start to build main activity.
Location Permission
Location details at android studio
The Marker (Huawei)
Default Map View
Max & Min ZoomPreference
Application view

In this tutorial, I try to explain how we integrate the HMS Map and HMS Location kit and add a marker & circle. I hope you found this tutorial helpful. Feel free to ask questions, please let me know in the comments below.

Now, you can use the both Location and map kit in one app.

See you with next medium share.

BR.

References:

--

--