HMS Core Location Kit - Huawei Developers

What is HMS Location?
HMS Core Location Kit essentially provides three functions: fused location, geo-fence, and activity identification.
a.
High Success Rate
Fast Locating
High Locating Accuracy
b..
Low Power Consumption
More Types of Fences
c.
More Types of Activities
Super GPS in Location Kit can recognize the visibility of satellite through 3D map matching and machine learning, improve the roadside identification accuracy 2X and correct the location results to the right side of the road.
The HMS SDK integration can be completed within 3 Man-Days
Integration Preparations
1.Register account and conduct developer certification
2.Create the signature file (if you don’t have)
3.Check the signature file info
4.Configure app info on AGC
Create app on AGC
Add app package name
Add the signature file info on AGC
5.Download the configuration file on AGC and add it to your project
3 steps to make Location works in your App
1. Get HMS location SDK
2.Coding
3. Test & Release
For details, see the link:
https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#0
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/location-guidev4

Related

[AppsUP] Collection of Integration Cases for Map Kit

More information about AppsUP contest, you can visit HUAWEI Developer Forum​
The AppsUP contest has already been online. You must not miss the impressive contest. In the last post, I have collected cases about Account Kit. Today I want to share the collection of Map Kit with you. Expect they will benefit you a lot.
HMS Map Kit Elucidated: Using React Native
HMS MAP Kit plays vital role in digital cartography. And introduct how to implement the HMS Map in react native application
How to integrate HMS Map Kit, add marker and draw circle
At this tutorial, the author will guide you how to integrate HMS Map to the project. And, also add a marker and draw a circle on the map.
How to implement HMS Map Kit – Xamarin
Huawei Maps support more functions than the Xamarin.Forms. Map like Traffic maps, Map events, Custom pins, Pin drag & drop, Draw lines, Draw Circles and more…To use HUAWEI Map Kit Xamarin SDK
Direction API With Huawei Map Kit (Solution)
HUAWEI Map Kit provides an SDK for map development. It covers map data of more than 200 countries and regions and supports dozens of languages. With this SDK, you can easily integrate map-based functions into your apps. This article will introduce you to how to use the Direction API of Huawei Map Kit.
Map Kit JavaScript API - Solution for cross platforms and web apps
There is another capability of Map Kit which is JavaScript API which provides the basic map display, map interaction, route planning, place search, geocoding, and other functions to meet requirements of most developers. This API can be used for web apps and any JS based cross platforms such as Ionic or Cordova.
Complete Guide [Site kit + Map Kit]
Customers of Huawei maps are business who use maps API like Ecommerce, real estate portals, travel portals etc. and end users who user the Huawei maps application through different devices. End users also experience the maps interface through different search experiences like the local business searches, hotel searches, and flight searches. This article will tell you how to Integrate Map Kit.
How to draw a route and show route steps with HMS Direction API
This tutorial will guide you how to use HMS Direction API, draw a route with polyline and show direction steps.
Setup Map on an Android Application in smart way
Now days, most of the application integrate Maps. This article will give you the process on how to do. Millions of users look up directions, plan their commutes, and catch a ride.as well as touch on the many things available through maps to enhance the user experience in mobile apps.
Add Clustering on Huawei Map. (Solution)
In this Article we will go through and develop Map Clustering feature in Huawei Map. Map clustering is not the Native feature of Huawei Map, we need to use add separate library in our project to achieve the map clustering feature.
[Maps + Directions] Plotting a route between two cities on a map
In this short tutorial, I will guide you step by step on how to plot a route between 2 cities (namely Toronto and Montreal in Canada) on a map using HMS Maps Kit and retrieving the data from Huawei Directions API.
HMS SITE MAP ( PART 1 )
HUAWEI Site Kit provides developers with convenient and secure access to diverse, place-related services. This article will tell you how to integrate HMS Core Site Kit into your apps along with AutoCompleteTextView, TextWatcher and Html format.
HMS SITE MAP ( PART 2 )
This article will tell you how to show a map using Map Kit after fetching the Latitude and Longitude from the details selected. Also you are going to see how to use the Site APIs and Map APIs using POSTMAN.
HMS SITE MAP ( PART 3 )
This article is also going to tell you how to use the Site APIs and Map APIs using POSTMAN.
All About Maps - Episode 1: Showing Routes from GPX files on Maps
This project aim to demonstrate how to implement the same map related use cases with different map providers in one codebase. This project will use Mapbox Maps, Google Maps, and Huawei HMS Map Kit.
All About Maps - Episode 2: Moving Map Camera to Bounded Regions
This episode talk about bounded regions, and the how to add a feature to the project so that camera is moved to a bounded region generated from a central point with a radius value.
Drawing on Map made easy with Huawei Map kit – Part 1
With the Huawei Maps SDK for Android, you can add maps to your application. You can also use API calls to add markers, polygons, and overlays to a basic map, and to change the user's view of a particular map area.
Drawing on Map made easy with Huawei Map kit – Part 2
In last article we learnt how to draw polyline, ground overlay, marker clusters and dragging the image. In this article we will draw polygon and customize hte map style.
I will regularly update this post in the following days. Keep an eye on this.
Any doubts or questions about Map Kit, let me know in the reply.

[AppsUP] Collection of Integration Cases for Analytics Kit

AppsUP contest has been launched since June 30. If you missed the optimal chance to participate in, hurry up now. This time I will share the collection of integration cases for Analytics Kit. If you still have no idea about integrating this kit. Hope this can help you know it better.
Huawei Mobile Services (HMS) Analytics Kit Implementation and Usage for Android
In this article, the author tries to explain Huawei Analytics Kit implementation for an Android app. In addition, he will create a demo project and check analysis on AppGallery Connect dashboard.
Analytics Kit – Customize START and END Analytics page events for no activity pages
This articles helps users to know how to track a specific navigation events for start or end pages in fragments or any specific space.
Data Export API of Analytic Kit
Data export functions is very useful for developers who use their own prefer Business intelligence (BI) system for unified data analysis.
Using advanced Analytics events with Kotlin
This post aims to help developers use Kotlin to implement the Advanced Analytics feature in their codebase.
Demystifying Data Binding - Android Jetpack Part 1 – Novice
Using data binding can lead to faster development times, faster execution times and easier to read (and maintain) code. In this article we will learn about Data binding library from Novoice mode to Proficient mode
Demystifying Data Binding - Android Jetpack Part 2 – Advanced
Data Binding allows you to bind data and UI elements so that when the data changes, the pertinent elements are updated on screen.
Demystifying Data Binding - Android Jetpack Part 3 – Proficient
Data Binding can be achieved by using main components of MVVM i.e. Live Data and View Model. In this article, the author introduces the proficient way to receives the latest available data If an activity or fragment is recreated due to a configuration change (for instance, device rotation).
Optimize Conversion Rate Using A/B Testing
With Huawei Analytics Kit, A/B testing can be a fantastic method to obtain valuable insight regarding visitor behavior and to improve applications or website conversion rate.
Multi-dimensional Event Analysis|HUAWEI Analytics Kit (1)
HUAWEI Analytics Kit is a one-stop data analysis platform for mobile app developers that utilizes data to drive daily app operations, bringing out dynamic details in a comprehensive, timely, and efficient manner.
Change your Data Storage in a Published App
This article explains how to generate a work order for changing this data storage once your app has been released with a different one than the one you need.
Related articles you can refer:
[AppsUP] Collection of Integration Cases for Account Kit
[AppsUP] Collection of Integration Cases for Map Kit
[AppsUP] Collection of Integration Cases for Push Kit
If you want to know other cases about this kit, let your comment below or ask your questions in HUAWEI Developer Forum.

HMS Toolkit Makes Integrating HMS Core Kits Effortless

Curious about how to integrate HMS Core kits into your apps? Or how to convert your apps integrated with third-party mobile services? Want the quickest and simplest way to release them on HUAWEI AppGallery?
Introducing HMS Toolkit.
This IDE plugin provides tools such as Getting Started, Configuration Wizard, and Repository and is designed for every stage of development: creation, coding, debugging, testing, releasing, and quality analysis. Armed with HMS Toolkit, you too can develop your own HMS Core-integrated apps in Android Studio and release them at lower cost and higher efficiency.
Every development phase, faster and easier
Getting Started demonstrates each HMS Core kit.
Configuration Wizard walks you through all the necessary settings, so no more looking up the manual or switching tools. Configure multiple kits at the same time, for different scenarios, so no more four-hour jobs – now just 5 minutes.
Repository shows you SDK version, package size, and usage to make integration and version a one-stop-shop. Automatically add an SDK library dependency after you select the library, get the latest SDK version, and upgrade the SDK with just one click.
Coding Assistant offers HMS Core API descriptions and sample code and templates by scenario. Drag and drop to generate and configure code, and get automatic issue warnings and recommendations.
Convertor helps you move from third-party APIs to HMS APIs. Convert your source code either with Add HMS API (add code to call HMS APIs to match third-party APIs so both can be called as needed), or To HMS API (replace code to call third-party APIs with code to match HMS APIs so only HMS APIs can be called).
Cloud Debugging uses a remote real device to quickly locate and resolve problems. Currently, choose from various Huawei devices if you're in the Chinese mainland, Russia, Asia Pacific, and West Europe. Quickly access the nearest site for single-step or ADB debugging. Drag and drop to upload files, zoom in and out onscreen, and toggle definitions between smooth, SD, and HD on the remote real device as needed.
Cloud Testing tests your app in one click to quickly detect problems on any device. Get screenshots for compatibility, stability, performance, and power consumption.
Publish to AppGallery Connect makes uploading easier to do from the IDE. Choose to upload either the packaged APK of the current project (default) or a local package, and its parameters will be checked against the release requirements. Once it's uploaded, you'll be prompted to access the HUAWEI AppGallery Connect release page.
HMS Toolkit also allows you to generate an API or demo project in one click for quickly verifying and calling the image classification model in your app.
Easy to install
Start Android Studio, go to File > Settings > Plugins > Marketplace, search for HMS Toolkit, and click Install. Or sign in and get it on the HUAWEI Developers official website.
HMS Toolkit will continue to be optimized to help you and other developers around the world create a smart life for users.
If you have any questions, please submit a ticket. Huawei technical support will reply to you as soon as possible.
For more information about HMS Toolkit, go to >>
For how to quickly integrate each kit using HMS Toolkit, go to >>
For more operation tutorials, go to >>
For more details, you can go to:
l Our official website
l Our Development Documentation page, to find the documents you need
l GitHub to download demos and sample codes
l Stack Overflow to solve any integration problems
Very useful sharing.

How to Target Ads Precisely While Protecting User Privacy

Background​
When using an app, if pop-up ads keep appearing when we browse app pages but we are not interested in the advertised content, not only will our browsing experience be negatively affected, but we will also quickly become tired of the advertised content. Unwanted ads are usually annoying. Aimless ad targeting and delivery will result in the wrong ads being sent to users and cause poor ad performance.
So, as publishers, how do we guarantee that we can deliver ads to audiences who will be interested in them and how can we decrease users' resistance to advertising? The answer is to collect information about the user requirements of your target audiences or to really know them, and to do so in a way that causes the least annoyance. But when a user is unwilling to share their personal data, such as age, gender, and interests, with my app, placing an ad based on the page that the user is browsing is a good alternative.
For example, a user is reading an article in a news app about the fast-paced development of electric vehicles, rapidly improving battery technology, and the expansion of charging stations in cities. If the targeted advertising mechanism understands the context of the article, when users continue to read news articles in the app, they may see native ads from nearby car dealerships for test driving electric vehicles or ads about special offers for purchasing electric vehicles of a certain brand. In this way, user interests can be accurately discovered, and publishers can perform advertising based on the keywords and other metadata included in the contextual information of the app page, or any other content users are reading or watching, without having to collect users' personal information.
But I can't integrate these features all by myself, so I started searching for tools to help me request and deliver ads based on the contextual information on an app page. That's when I had the great fortune to discover Ads Kit of HMS Core. Ads Kit supports personalized and non-personalized ads. Personalized ad requests require users to grant the app access to some of their personal information, which may not be palatable for some users. Non-personalized advertising, however, is not constrained by this requirement.
Non-personalized ads are not based on users' past behavior. Instead, they target audiences using contextual information. The contextual information includes the user's rough geographical location (such as city) authorized by the user, basic device information (such as the mobile phone model), and content of the current app or search keyword. When a user browses a piece of content in your app, or searches for a topic or keyword to express a specific interest, the contextual ad system scans a specific word or a combination of words, and pushes an ad based on the page content that the user is browsing.
Today, data security and personal privacy requirements are becoming more and more stringent. Many users are very hesitant to provide personal information, which means that precise ad delivery is becoming harder and harder to achieve. Luckily, Ads Kit requests ads based on contextual information, enabling publishers to perform ad delivery with a high degree of accuracy while protecting user privacy and information.
Now let's take a look at the simple steps we need to perform in order to quickly integrate Ads Kit and perform contextual advertising.
Integration Steps​
1. Ensure that the following prerequisites are met before you integrate the Ads Kit:
HMS Core (APK) 4.0.0.300 or later should be installed on devices. If the APK is not installed or an earlier version has been installed, you will not be able to call the APIs of the Ads Kit.
Before you begin the integration process, make sure that you have registered as a Huawei developer and completed identity verification on HUAWEI Developers.
Create a project and add an app to the project for later SDK integration.
2. Import the Ads SDK.
You can integrate the Ads SDK using the Maven repository.
That is, before you start developing an app, configure the Maven repository address for Ads SDK integration in your Android Studio project.
The procedure for configuring the Maven repository address in Android Studio is different for Gradle plugin versions earlier than 7.0, Gradle plugin 7.0, and Gradle plugin versions 7.1 and later. Configure the Maven repository address accordingly based on your Gadle plugin version.
3. Configure network permissions.
To allow apps to use cleartext HTTP and HTTPS traffic on devices with targetSdkVersion 28 or later, configure the following information in the AndroidManifest.xml file:
Code:
<application
...
android:usesCleartextTraffic="true"
>
...
</application>
4. Configure obfuscation scripts.
Before building the APK, configure the obfuscation configuration file to prevent the SDK from being obfuscated.
Open the obfuscation configuration file proguard-rules.pro in your app's module directory of your Android project, and add configurations to exclude the SDK from obfuscation.
Code:
-keep class com.huawei.openalliance.ad.** { *; }
-keep class com.huawei.hms.ads.** { *; }
5. Initialize the SDK.
You can initialize the SDK in the activity, or initialize the SDK by calling the HwAds.init(Context context) API in the AdSampleApplication class upon app launch. The latter method is recommended, but you have to implement the AdSampleApplication class by yourself.
6. Request ads based on contextual information.
The SDK provides the setContentBundle method in the AdParam.Builder class for you to pass contextual information in an ad request.
The sample code is as follows:
Code:
RewardAd rewardAd = new RewardAd(this, rewardId);
AdParam.Builder adParam = new AdParam.Builder();
String mediaContent = "{\"channelCategoryCode\":[\"TV series\"],\"title\":[\"Game of Thrones\"],\"tags\":[\"fantasy\"],\"relatedPeople\":[\"David Benioff\"],\"content\":[\"Nine noble families fight for control over the lands of Westeros.\"],\"contentID\":[\"123123\"],\"category\":[\"classics\"],\"subcategory\":[\"fantasy drama\"],\"thirdCategory\":[\"mystery\"]}\n";
adParam.setContentBundle(mediaContent);
rewardAd.loadAd(adParam.build(), new RewardAdLoadListener());
Conclusion​Nowadays, advertising is an important way for publishers to monetize their apps and content, and how to deliver the right ads to the right audiences has become a key focus point. In addition to creating high quality ads, significant efforts should be placed on ensuring precise ad delivery. As an app developer and publisher, I was always searching for methods to improve ad performance and content monetization in my app. In this article, I briefly introduced a useful tool, Ads Kit, which helps publishers request ads based on contextual information, without needing to collect users' personal information. What's more, the integration process is quick and easy and only involves a few simple steps. I'm sure you'll find it useful for improving your app's ad performance.
References​Development Guide of Ads Kit

FAQs About Integrating HMS Core Map Kit

HMS Core Map Kit provides an SDK for map development. With the SDK, global developers can quickly integrate map-related capabilities into their apps to customize how their map displays and functions.
Developers may encounter various problems when integrating Map Kit. Here, I'll share some typical problems I encountered during the integration.
The in-app map cannot be loaded (shows the grid map or loads only a part of the map) after Map SDK integration. What to do?​
(1) Verify that Map Kit has been enabled and the certificate fingerprint is correctly configured.
(2) Verify that the version of HMS Core (APK) is 4.0.0 or later. If the Map SDK version is 6.X, you need to update HMS Core (APK) to the 6.X version.
(3) Verify that the app ID in your project is the same as that in AppGallery Connect.
(4) Verify that you have configured the SHA-256 certificate fingerprint. You need to generate a signing certificate fingerprint and configure it in AppGallery Connect.
(5) Verify that the AppGallery Connect configuration file agconnect-services.json is copied to the app-level root directory of your project.
(6) Verify that you have copied the generated signing certificate file to the app directory of your project and configured the signing information in android in the build.gradle file.
How to obtain the real-time location of a user using Map Kit?​
You can do the following to achieve this:
(1) Enable the my-location function.
Code:
hMap.setMyLocationEnabled(true);
hMap.getUiSettings().setMyLocationButtonEnabled(true);
You can click here to learn more.
(2) Call getPosition() to obtain the current-location marker.
You can click here to learn more.
After the map is loaded, UI controls such as the watermark, compass, my-location icon, and zoom icons are not displayed on the map. What can we do about this?​
(1) Check the value of the zOrderOnTop attribute.
zOrderOnTop(true): The map is displayed at the top layer and covers other controls.
zOrderOnTop(false): The map is not displayed at the top layer and other controls can be properly displayed.
(2) Set zoomControlsEnabled, compassEnabled, and setMyLocationEnabled to true.
You can click here for more details.
Why does the my-location function not work?​
(1) Verify that the android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION permissions have been enabled. (Also, verify that the permissions are dynamically applied and the location switch is turned on.)
(2) Verify that the following functions have been enabled:
Code:
// Enable the my-location layer.
map.setMyLocationEnabled(true);
// Enable the my-location icon.
map.getUiSettings().setMyLocationButtonEnabled(true);
Why does frame freezing occur in the app when 2000 markers are added?​
If markers are added when the map.clear() method is called to clear markers, markers will be clustered again, cluttering the map display.
When calling the map.clear() method, you can add the code line map.setMarkersClustering(false) behind the method to prevent markers from being clustered again when they are cleared.
References​
HMS Core Map Kit official website
HMS Core Map Kit development guide

Categories

Resources