{"id":19672731,"url":"https://github.com/halilozel1903/huaweimapkitapp","last_synced_at":"2025-10-12T10:39:00.171Z","repository":{"id":91423837,"uuid":"306945772","full_name":"halilozel1903/HuaweiMapKitApp","owner":"halilozel1903","description":"An Android application related to Huawei Map Kit. 🗺","archived":false,"fork":false,"pushed_at":"2023-11-12T18:31:56.000Z","size":8070,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-29T01:42:16.819Z","etag":null,"topics":["android","android-app","android-application","android-map","android-maps","android-sdk","hms","hms-location","hms-map","hms-sample","hmsbuild","hmscore","huawei","huawei-map-kit","huawei-maps","huawei-mobile-services","huawei-sdk","kotlin-android","kotlin-language","map"],"latest_commit_sha":null,"homepage":"https://halilozel1903.medium.com/huawei-map-kit-d436944b1773","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halilozel1903.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-24T18:24:18.000Z","updated_at":"2022-06-23T06:05:23.000Z","dependencies_parsed_at":"2025-04-29T01:51:47.501Z","dependency_job_id":null,"html_url":"https://github.com/halilozel1903/HuaweiMapKitApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/halilozel1903/HuaweiMapKitApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilozel1903%2FHuaweiMapKitApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilozel1903%2FHuaweiMapKitApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilozel1903%2FHuaweiMapKitApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilozel1903%2FHuaweiMapKitApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halilozel1903","download_url":"https://codeload.github.com/halilozel1903/HuaweiMapKitApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halilozel1903%2FHuaweiMapKitApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011058,"owners_count":26084865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-app","android-application","android-map","android-maps","android-sdk","hms","hms-location","hms-map","hms-sample","hmsbuild","hmscore","huawei","huawei-map-kit","huawei-maps","huawei-mobile-services","huawei-sdk","kotlin-android","kotlin-language","map"],"created_at":"2024-11-11T17:13:10.200Z","updated_at":"2025-10-12T10:39:00.137Z","avatar_url":"https://github.com/halilozel1903.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Huawei Map Kit App 🗺 📍 🧭\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huawei.png)\n\n## What is Huawei Map Kit ⁉️\nMap 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.\n\nHUAWEI Map Kit uses the WGS 84 GPS coordinate system, which meets most map development requirements outside China, including:\nMap display: Displays buildings, roads, water systems, and Points of Interest (POIs).\nMap interaction: Controls the interaction gestures and buttons on the map.\nMap drawing: Adds location markers, map layers, overlays, and various shapes. \u003cbr\u003e\n\n## How to use Huawei Map Kit 🧐\n\n- First, you need to register a Huawei Developer account. You can register it for free from the link below.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiDeveloperAccount.png)\u003cbr\u003e\u003cbr\u003e\n\nhttps://id5.cloud.huawei.com/CAS/portal/userRegister/regbyemail.html\n\n- After opening the developer account, we will create a project\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiProject.png)\u003cbr\u003e\u003cbr\u003e\n\n- And open an application in the project.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiApp.png)\u003cbr\u003e\u003cbr\u003e\n\n- Need to adjust the settings of the application. Since it is a sample project, I share all the information with you.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiSettings.png)\u003cbr\u003e\u003cbr\u003e\n\n- Need to produce SHA-256 certificate fingerprints. We click on the Gradle area on the right in Android Studio.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/gradleSign.png)\u003cbr\u003e\u003cbr\u003e\n\n- Clicking the signingReport button under Tasks, we generate sha 256 code. We add it to the relevant field in the project settings.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/sha256.png)\u003cbr\u003e\u003cbr\u003e\n\n- Need to activate MapKit from the Manage API section.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiMapKit.png)\u003cbr\u003e\u003cbr\u003e\n\n- Download the `agconnect-services.json` file. Then we add it to the app folder of our project.\n\n![Screenshot](https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/agconnect.png)\u003cbr\u003e\u003cbr\u003e\n\n- Define the necessary permissions in the `AndroidManifest.xml` file.\n\n```kotlin\n\u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /\u003e\n\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" /\u003e\n\u003cuses-permission android:name=\"com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA\" /\u003e\n\u003cuses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" /\u003e\n``` \n\u003cbr\u003e\n\n- In the `build.gradle(HuaweiMapKitApp)` field, we add the necessary codes for Huawei Map Kit.\n\n```kotlin\nbuildscript {\n    ext.kotlin_version = \"1.6.21\"\n    repositories {\n        google()\n        mavenCentral()\n        maven { url 'https://developer.huawei.com/repo/' }\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:7.2.1'\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n        classpath 'com.huawei.agconnect:agcp:1.6.0.300'\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        maven {\n            url 'https://developer.huawei.com/repo/'\n        }\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n```\n\u003cbr\u003e\n\n- Add the plugin in `build.gradle(:app)`\n\n```kotlin\nplugins {\n    id 'com.android.application'\n    id 'kotlin-android'\n    id 'com.huawei.agconnect'\n}\n```\n\u003cbr\u003e\n\n- Add the Map Kit dependency in `build.gradle(:app)`\n\n```kotlin\ndependencies {\n    implementation 'androidx.core:core-ktx:1.7.0'\n    implementation 'androidx.appcompat:appcompat:1.4.1'\n    implementation 'com.google.android.material:material:1.6.0'\n    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'\n    implementation 'com.huawei.hms:maps:6.4.1.300'\n}\n```\n\u003cbr\u003e\n\n- Now can add map to our layout file (`activity_main.xml`).\n\n```kotlin\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003candroidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n    \u003ccom.huawei.hms.maps.MapView\n        xmlns:map=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/huaweiMapView\"\n        map:uiCompass=\"true\"\n        map:uiZoomControls=\"true\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" /\u003e\n\n\u003c/androidx.constraintlayout.widget.ConstraintLayout\u003e\n```\n\u003cbr\u003e\n\n- Make map settings in the `MainActivity.kt`. Add a static location information and marker to the map.\n\n```kotlin\nclass MainActivity : AppCompatActivity(), OnMapReadyCallback {\n\n    private lateinit var huaweiMap: HuaweiMap\n    private lateinit var marker: Marker\n    private lateinit var cameraUpdate: CameraUpdate\n    private lateinit var cameraPosition: CameraPosition\n    private lateinit var binding: ActivityMainBinding\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        // View Binding Settings\n        binding = ActivityMainBinding.inflate(layoutInflater)\n        val view = binding.root\n        setContentView(view)\n\n        var mapViewBundle: Bundle? = null\n        if (savedInstanceState != null) {\n            mapViewBundle = savedInstanceState.getBundle(MAP_BUNDLE_KEY)\n        }\n        binding.huaweiMapView.onCreate(mapViewBundle)\n        binding.huaweiMapView.getMapAsync(this)\n    }\n\n\n    // if the map is ready\n    override fun onMapReady(map: HuaweiMap) {\n\n        // mapping\n        huaweiMap = map\n\n        // marker add\n        marker = huaweiMap.addMarker(\n            MarkerOptions()\n                .icon(BitmapDescriptorFactory.defaultMarker()) // default marker\n                .title(\"Huawei Turkey\") // maker title\n                .position(LatLng(41.031261, 29.117277)) // marker position\n\n        )\n        // camera position settings\n        cameraPosition = CameraPosition.builder()\n            .target(LatLng(41.031261, 29.117277))\n            .zoom(10f)\n            .bearing(2.0f)\n            .tilt(2.5f).build()\n        cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition)\n        huaweiMap.moveCamera(cameraUpdate)\n\n    }\n    // constant\n    companion object {\n        private const val MAP_BUNDLE_KEY = \"MapBundleKey\"\n    }\n}\n```\n- Have done all the necessary actions. Congratulations! 🥳 You have developed the first Huawei Maps application.\n\n## Screenshots 📱\n\n\u003cimg src=\"https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiMapKitScreen1.png\" width=\"300\" /\u003e \u003cimg src=\"https://github.com/halilozel1903/HuaweiMapKitApp/blob/master/photos/huaweiMapKitScreen2.png\" width=\"300\" /\u003e\n\n\n## Resources 📚\n- https://developer.huawei.com/consumer/en/hms/huawei-MapKit/\n- https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-sdk-introduction-0000001050158633\n- https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/hms-map-v4-faq\n- https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-sdk-version-change-history-0000001050156688\n\n\u003cbr\u003e\n\n## License ℹ️\n```\nMIT License\n\nCopyright (c) 2022 Halil OZEL\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalilozel1903%2Fhuaweimapkitapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalilozel1903%2Fhuaweimapkitapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalilozel1903%2Fhuaweimapkitapp/lists"}