Integrating Dynamic Tag Manager (DTM) in applications to Improve Business - Huawei Developers

Introduction
Huawei Dynamic Tag Manager (DTM) is a dynamic tag management system. We can manage tags, events dynamically from web UI. It also helps to send data to third party analytics platform like Huawei Analytics, Google Analytics, Facebook Analytics and AppsFlyer etc.
How DTM improves our business?
As we know, it’s a Dynamic Tag Management System. So if we are sending events on any page, button click or Navigation to other screens, we can filter those events dynamically from web.
For example, Pharmacy app is used for purchasing medicine online and it shows the list of medicine and price. When we click on Buy button to purchase medicine, it will send the Medicine name, id, price and description to Huawei Analytics. But if we are putting condition on web UI for price (price > 10), then we will get analytics data of those medicine which is having price more than 10 INR. Like this we can manage lot of things. With these features we can analyze our data smoothly and can make profit which will help to improve our business.
Let us start with the project configuration part:
Step 1: Implement IAP (In-App Purchase) in Pharmacy App.
Step 2: Install Huawei DTM NuGet Package.
Step 3: Install Huawei.Hms.Hianalytics package using Step 2.
Step 4: Select Project Setting > Grow > Dynamic Tag Manager and enable it.
Step 5: Enter the details and click OK to create DTM configuration.
Step 6: After configuration success, it will create the Configuration code.
Step 7: Click Version tab and create version.
Step 8: Click Variable tab and click Configure/Create button to set Preset/Custom variable for events and tags.
a) Preset Variable: These are predefined variables which can be used to configure most of the tags and conditions. Currently DTM provides 18 preset variables.
b) Custom Variable: You can also create your custom variable for tags and conditions according to your project. Currently 6 types of custom variables are present.
Step 9: Click Condition tab and create the condition.
Step 10: Click Tag tab and create the tag.
Step 11: Select Project Setting > Huawei Analytics > App debugging and enable it for getting real time analytics data.
Step 12: For checking the real time events, enable debug mode by using below commands.
Enable
adb shell setprop debug.huawei.hms.analytics.app <package_name>
Disable
adb shell setprop debug.huawei.hms.analytics.app .none.
Now your configuration part completed.
Let us start with the implementation part:
Step 1: Initialize Huawei Analytics inside MainActivity’s OnCreate() method.
Step 2: Send the events using Huawei Analytics OnEvent() method.
Now implementation part done.
Result
Tips and Tricks
Please enable app debug mode using command “adb shell setprop debug.huawei.hms.analytics.app <package_name>”.
Conclusion
In this Article, We have learnt how to improve our business with the help of Huawei Dynamic Tag Management System. We can also place some ads on the basis of user engagement on the application to maximize our profit.
To learn more about DTM, please visit:
>> DTM official website
>> DTM development guide
>> DTM codelab

Thanks for sharing!!

Can we get customized list of events with this DTM?

muraliameakula said:
Can we get customized list of events with this DTM?
Click to expand...
Click to collapse
Yes, DTM can get all the custom events and do some processing.

How long it takes to reflect DTM condition change in the client application?

Basavaraj.navi said:
How long it takes to reflect DTM condition change in the client application?
Click to expand...
Click to collapse
Hi, for Android/iOS, it takes 6 hours. for Web it takes 15 minutes.

What are the permissions required?

muraliameakula said:
What are the permissions required?
Click to expand...
Click to collapse
Hi, DTM SDK will be started and closed with the call of relevant interfaces. No additional actions will be done in the background. The required permissions are: INTERNET and ACCESS_NETWORK_STATE.

Related

[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.

Beginner: Integration of Huawei Remote configuration in flutter for taxi booking application

Introduction
Welcome Folks, in this article, I will explain what is Huawei Remote configuration? How does Huawei Remote Configuration work in Flutter? At the end of this tutorial, we will create the Huawei Remote Configuration Flutter taxi booking application.
In this example, I am enabling/Disabling share feature from remote configuration. When share feature is enabled user can book share cab otherwise user can’t see the share feature.
What is Huawei Remote Configuration?
Huawei Remote Configuration is cloud service. It changes the behavior and appearance of your app without publishing an app update on App Gallery for all active users. Basically, Remote Configuration allows you to maintain parameters on the cloud, based on these parameters we control the behavior and appearance of your app. In the festival scenario, we can define parameters with the text, color, images for a theme which can be fetched using Remote Configuration.
How does Huawei Remote Configuration work?
Huawei Remote Configuration is a cloud service that allows you change the behavior and appearance of your app without requiring users to download an app update. When using Remote Configuration, you can create in-app default values that control the behavior and appearance of your app. Then, you can later use the Huawei console or the Remote Configuration to override in-app default values for all app users or for segments of your user base. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.
In Remote Configuration, we can create in-app default values that control the behavior and appearance (such as text, color, and image, etc.) in the app. Later on, with the help of Huawei Remote Configuration, we can fetch parameters from the Huawei remote configuration and override the default value.
Integration of Remote configuration
1. Configure application on the AGC.
2. Client application development process.
Configure application on the AGC
This step involves the couple of steps, as follows.
Step 1: We need to register as a developer account in AppGallery Connect. If you are already developer ignore this step.
Step 2: Create an app by referring to Creating a Project and Creating an App in the Project
Step 3: Set the data storage location based on current location.
Step 4: Enabling Remote configuration. Open AppGallery connect, choose Grow > Remote confihuration
Step 5: Generating a Signing Certificate Fingerprint.
Step 6: Configuring the Signing Certificate Fingerprint.
Step 7: Download your agconnect-services.json file, paste it into the app root directory.
Client application development process
This step involves the couple of steps as follows.
Step 1: Create flutter application in the Android studio (Any IDE which is your favorite).
Step 2: Add the App level gradle dependencies. Choose inside project Android > app > build.gradle
1
2apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies
1
2maven { url 'https://developer.huawei.com/repo/' }
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add the below permissions in Android Manifest file.
1
2<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Step 3: Add the agconnect_remote_config in pubspec.yaml
Step 4: Add downloaded file into outside project directory. Declare plugin path in pubspec.yaml file under dependencies.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20dependencies:
flutter:
sdk: flutter
huawei_account:
path: ../huawei_account/
huawei_location:
path: ../huawei_location/
huawei_map:
path: ../huawei_map/
huawei_analytics:
path: ../huawei_analytics/
huawei_site:
path: ../huawei_site/
huawei_push:
path: ../huawei_push/
huawei_dtm:
path: ../huawei_dtm/
agconnect_crash: ^1.0.0
agconnect_remote_config: ^1.0.0
http: ^0.12.2
To achieve Remote configuration service example let us follow the steps.
1. AGC Configuration
2. Build Flutter application
Step 1: AGC Configuration
1. Sign in to AppGallery Connect and select My apps.
2. Select the app in which you want to integrate Huawei Remote configuration Service.
3. Navigate to Grow > Remote configuration
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Step 2: Build Flutter application
In this example, I am enabling/Disabling share feature from remote configuration. When share feature is enabled, user can book share cab otherwise user can’t see the share feature
Basically, Huawei Remote Configuration has three different configurations as explained below.
Default Configuration: In this configuration default values defined in your app, if no matching key found on remote configuration sever than default value is copied the in active configuration and returned to the client.
1
2
3
4
5
6
7
8
9Map<String, dynamic> defaults = {
'enable_feature_share': false,
'button_color': 'red',
'text_color': 'white',
'show_shadow_button': true,
'default_distance': 4.5,
'min_price':80
};
AGCRemoteConfig.instance.applyDefaults(defaults);
Fetched Configuration: Most recent configuration that fetched from the server but not activated yet. We need to activate these configurations parameters, then all value copied in active configuration.
1
2
3
4
5
6
7
8
9
10_fetchAndActivateNextTime() async {
await AGCRemoteConfig.instance.applyLastFetched();
Map value = await AGCRemoteConfig.instance.getMergedAll();
setState(() {
_allValue = value;
});
await AGCRemoteConfig.instance.fetch().catchError((error)=>log(error.toString()));
}
Active Configuration: It directly accessible from your app. It contains values either default and fetched.
1
2
3
4
5
6
7
8
9
10fetchAndActivateImmediately() async {
await AGCRemoteConfig.instance.fetch().catchError((error)=>log(error.toString()));
await AGCRemoteConfig.instance.applyLastFetched();
Map value = await AGCRemoteConfig.instance.getMergedAll();
setState(() {
_allValue = value;
});
}
Fetch Parameter value
After default parameter values are set or parameter values are fetched from Remote Configuration, you can call AGCRemoteConfig.getValue to obtain the parameter values through key values to use in your app.
1
2
3
4
5
6
7
8
9
10
11
12_fetchParameterValue(){
AGCRemoteConfig.instance.getValue('enable_feature_share').then((value){
// onSuccess
if(value == 'true'){
_isVisible = true;
}else{
_isVisible =false;
}
}).catchError((error){
// onFailure
});
}
Resetting Parameter Values
You can clear all existing parameter using below function.
1
2
3_resetParameterValues(){
AGCRemoteConfig.instance.clearAll();
}
What all can be done using Huawei remote configuration
Displaying Different Content to Different Users: Remote Configuration can work with HUAWEI Analytics to personalize content displayed to different audiences. For example, office workers and students will see different products and UI layouts in an app
Adapting the App Theme by Time: You can set time conditions, different app colors, and various materials in Remote Configuration to change the app theme for specific situations. For example, during the graduation season, you can adapt your app to the graduation theme to attract more users.
Releasing New Functions by User Percentage: Releasing new functions to all users at the same time will be risky. Remote Configuration enables new function release by user percentage for you to slowly increase the target user scope, effectively helping you to improve your app based on the feedback from users already exposed to the new functions.
Features of Remote configuration
1. Add parameters
2. Add conditions
1. Adding Parameters: In this you can add parameter with value as many as you want. Later you can also change the value that will be automatically reflected in the app. After adding all the required parameters, lets release the parameter.
2. Adding condition: This feature helps developer to add the conditions based on the below parameters. And conditions can be released.
App Version
OS version
Language
Country/Region
Audience
User Attributes
Predictions
User Percentage
Time
App Version: Condition can be applied on app versions. Which has four operator Include, Exclude, Equal, Include regular expression. Based on these four operators you can add conditions.
OS Version: Using the developer can add condition based on android OS version.
Language: Developer can add the condition based on the language.
Country/Region: Developer can add condition based on the country or region.
User percentage: Developer can roll feature to users based on the percentage of the users between 1-100%.
Time: Developer can use time condition to enable or disable some feature based on time. For example if the feature has to enable on particular day.
After adding required condition, release all the added conditions
Result
Tips and Tricks
Download latest HMS Flutter plugin.
Check dependencies downloaded properly.
Latest HMS Core APK is required.
Conclusion
In this article, we have learnt integration of Huawei Remote configuration, how to add the parameters, how to add the Conditions, how to release parameters and conditions and how to fetch the remote data in application and how to clear the data in flutter Taxi booking application.
Reference
Huawei Remote Configuration
Happy coding
Basavaraj.navi said:
Introduction
Welcome Folks, in this article, I will explain what is Huawei Remote configuration? How does Huawei Remote Configuration work in Flutter? At the end of this tutorial, we will create the Huawei Remote Configuration Flutter taxi booking application.
In this example, I am enabling/Disabling share feature from remote configuration. When share feature is enabled user can book share cab otherwise user can’t see the share feature.
What is Huawei Remote Configuration?
Huawei Remote Configuration is cloud service. It changes the behavior and appearance of your app without publishing an app update on App Gallery for all active users. Basically, Remote Configuration allows you to maintain parameters on the cloud, based on these parameters we control the behavior and appearance of your app. In the festival scenario, we can define parameters with the text, color, images for a theme which can be fetched using Remote Configuration.
How does Huawei Remote Configuration work?
Huawei Remote Configuration is a cloud service that allows you change the behavior and appearance of your app without requiring users to download an app update. When using Remote Configuration, you can create in-app default values that control the behavior and appearance of your app. Then, you can later use the Huawei console or the Remote Configuration to override in-app default values for all app users or for segments of your user base. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.
In Remote Configuration, we can create in-app default values that control the behavior and appearance (such as text, color, and image, etc.) in the app. Later on, with the help of Huawei Remote Configuration, we can fetch parameters from the Huawei remote configuration and override the default value.
Integration of Remote configuration
1. Configure application on the AGC.
2. Client application development process.
Configure application on the AGC
This step involves the couple of steps, as follows.
Step 1: We need to register as a developer account in AppGallery Connect. If you are already developer ignore this step.
Step 2: Create an app by referring to Creating a Project and Creating an App in the Project
Step 3: Set the data storage location based on current location.
Step 4: Enabling Remote configuration. Open AppGallery connect, choose Grow > Remote confihuration
Step 5: Generating a Signing Certificate Fingerprint.
Step 6: Configuring the Signing Certificate Fingerprint.
Step 7: Download your agconnect-services.json file, paste it into the app root directory.
Client application development process
This step involves the couple of steps as follows.
Step 1: Create flutter application in the Android studio (Any IDE which is your favorite).
Step 2: Add the App level gradle dependencies. Choose inside project Android > app > build.gradle
1
2apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies
1
2maven { url 'https://developer.huawei.com/repo/' }
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add the below permissions in Android Manifest file.
1
2<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Step 3: Add the agconnect_remote_config in pubspec.yaml
Step 4: Add downloaded file into outside project directory. Declare plugin path in pubspec.yaml file under dependencies.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20dependencies:
flutter:
sdk: flutter
huawei_account:
path: ../huawei_account/
huawei_location:
path: ../huawei_location/
huawei_map:
path: ../huawei_map/
huawei_analytics:
path: ../huawei_analytics/
huawei_site:
path: ../huawei_site/
huawei_push:
path: ../huawei_push/
huawei_dtm:
path: ../huawei_dtm/
agconnect_crash: ^1.0.0
agconnect_remote_config: ^1.0.0
http: ^0.12.2
To achieve Remote configuration service example let us follow the steps.
1. AGC Configuration
2. Build Flutter application
Step 1: AGC Configuration
1. Sign in to AppGallery Connect and select My apps.
2. Select the app in which you want to integrate Huawei Remote configuration Service.
3. Navigate to Grow > Remote configuration
Step 2: Build Flutter application
In this example, I am enabling/Disabling share feature from remote configuration. When share feature is enabled, user can book share cab otherwise user can’t see the share feature
Basically, Huawei Remote Configuration has three different configurations as explained below.
Default Configuration: In this configuration default values defined in your app, if no matching key found on remote configuration sever than default value is copied the in active configuration and returned to the client.
1
2
3
4
5
6
7
8
9Map<String, dynamic> defaults = {
'enable_feature_share': false,
'button_color': 'red',
'text_color': 'white',
'show_shadow_button': true,
'default_distance': 4.5,
'min_price':80
};
AGCRemoteConfig.instance.applyDefaults(defaults);
Fetched Configuration: Most recent configuration that fetched from the server but not activated yet. We need to activate these configurations parameters, then all value copied in active configuration.
1
2
3
4
5
6
7
8
9
10_fetchAndActivateNextTime() async {
await AGCRemoteConfig.instance.applyLastFetched();
Map value = await AGCRemoteConfig.instance.getMergedAll();
setState(() {
_allValue = value;
});
await AGCRemoteConfig.instance.fetch().catchError((error)=>log(error.toString()));
}
Active Configuration: It directly accessible from your app. It contains values either default and fetched.
1
2
3
4
5
6
7
8
9
10fetchAndActivateImmediately() async {
await AGCRemoteConfig.instance.fetch().catchError((error)=>log(error.toString()));
await AGCRemoteConfig.instance.applyLastFetched();
Map value = await AGCRemoteConfig.instance.getMergedAll();
setState(() {
_allValue = value;
});
}
Fetch Parameter value
After default parameter values are set or parameter values are fetched from Remote Configuration, you can call AGCRemoteConfig.getValue to obtain the parameter values through key values to use in your app.
1
2
3
4
5
6
7
8
9
10
11
12_fetchParameterValue(){
AGCRemoteConfig.instance.getValue('enable_feature_share').then((value){
// onSuccess
if(value == 'true'){
_isVisible = true;
}else{
_isVisible =false;
}
}).catchError((error){
// onFailure
});
}
Resetting Parameter Values
You can clear all existing parameter using below function.
1
2
3_resetParameterValues(){
AGCRemoteConfig.instance.clearAll();
}
What all can be done using Huawei remote configuration
Displaying Different Content to Different Users: Remote Configuration can work with HUAWEI Analytics to personalize content displayed to different audiences. For example, office workers and students will see different products and UI layouts in an app
Adapting the App Theme by Time: You can set time conditions, different app colors, and various materials in Remote Configuration to change the app theme for specific situations. For example, during the graduation season, you can adapt your app to the graduation theme to attract more users.
Releasing New Functions by User Percentage: Releasing new functions to all users at the same time will be risky. Remote Configuration enables new function release by user percentage for you to slowly increase the target user scope, effectively helping you to improve your app based on the feedback from users already exposed to the new functions.
Features of Remote configuration
1. Add parameters
2. Add conditions
1. Adding Parameters: In this you can add parameter with value as many as you want. Later you can also change the value that will be automatically reflected in the app. After adding all the required parameters, lets release the parameter.
2. Adding condition: This feature helps developer to add the conditions based on the below parameters. And conditions can be released.
App Version
OS version
Language
Country/Region
Audience
User Attributes
Predictions
User Percentage
Time
App Version: Condition can be applied on app versions. Which has four operator Include, Exclude, Equal, Include regular expression. Based on these four operators you can add conditions.
OS Version: Using the developer can add condition based on android OS version.
Language: Developer can add the condition based on the language.
Country/Region: Developer can add condition based on the country or region.
User percentage: Developer can roll feature to users based on the percentage of the users between 1-100%.
Time: Developer can use time condition to enable or disable some feature based on time. For example if the feature has to enable on particular day.
After adding required condition, release all the added conditions
Result
Tips and Tricks
Download latest HMS Flutter plugin.
Check dependencies downloaded properly.
Latest HMS Core APK is required.
Conclusion
In this article, we have learnt integration of Huawei Remote configuration, how to add the parameters, how to add the Conditions, how to release parameters and conditions and how to fetch the remote data in application and how to clear the data in flutter Taxi booking application.
Reference
Huawei Remote Configuration
Happy coding
Click to expand...
Click to collapse

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