Transmitting and Parsing Data from Fitness Devices Integrated with HUAWEI Health Kit - Huawei Developers

The popularization of wearable devices enables ever more convenient workout data collection, as well as the come into being of more sports and health apps that provide users with diverse daily workout tracking and data recording features.
HUAWEI Health Kit can be integrated to fitness devices through southbound APIs to help developers write workout data to apps, after which the developers will be able to parse the fields in the app, restore them to the corresponding parameters, and then display these parameters on the app UI.
So, how to parse the data returned by a fitness device?
The device integration service provided by HUAWEI Health Kit is based on the standard Fitness Machine Service (FTMS) protocol for data transmission. The FTMS provides a new definition of the standard Bluetooth protocol for training data transmission.
According to the protocol documentation, the standard FTMS protocol defines the workout status (warm-up, low-intensity, and high-intensity), fitness equipment status (on and standby), and supported fitness equipment types (treadmill, cross trainer, stair climber, rower, and indoor bike).
For details about the support of different types of fitness devices, see Chapter 3 of the FTMS protocol.
For specific parameters supported by a specific fitness device, see Chapter 4 of the FTMS protocol.
It should be noted that in the FTMS protocol, the byte order has been specified. In the FTMS protocol, little endian is used. That is, a higher address stores the data of the lower order byte data. For details, see Chapter 3.2 of the FTMS protocol.
Link to the FTMS protocol document:
https://www.bluetooth.com/specifications/specs/fitness-machine-service-1-0/
Take Rower Data as an example. The rowing machine returns the following data. What does it mean?
7e19002700d69c0000000061000000e4000d0000000024000000
Let's first look at the data format in the protocol. The data can be divided into two segments: Flags and Parameters.
{
"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"
}
Flags field parsing
According to the preceding figure, the data starts with a 2-byte (16-bit) flag, that is, 7E19. The hexadecimal representation is converted into binary, that is, 0111 1110 0001 1001.
But don't forget that FTMS uses little endian, that is, the first 8 digits (from left to right) store the lower bits of data, so the actual read order should be the following.
According to the document, we can find that the flag indicates that the data contains the following fields: (For details, see the field description in the FTMS protocol.)
According to the document, we can find that the flag indicates that the data contains the following fields: (For details, see the field description in the FTMS protocol.)
At this moment, we can refer to the description of 4.8.1.1 Flags Field in the FTMS protocol to obtain the information contained in the subsequent fields indicated by this flag.
It should be noted that a quantity of parameters identified by each bit is different, and one bit corresponds to a plurality of parameters. For a specific correspondence between a bit and a parameter in this example, refer to the following table.
Then we will be able to obtain the 13 parameters contained in the subsequent fields indicated by this flag:
Stroke Rate
Stroke Count
Average Stroke Rate
Total Distance
Instantaneous Pace
Average Pace
Instantaneous Power
Average Power
Total Energy
Energy Per Hour
Energy Per Minute
Elapsed Time
Remaining Time
We can then start parsing the parameters.
Parameter field parsing
By referring to the format definition of each parameter in the guide, we can divide the data of the parameter segment based on the format definition to match each parameter. In this example, the data is divided as follows:
00-2700-d6-9c0000-0000-6100-0000-e400-0d00-0000-00-2400-0000
Convert the segmented parameter byte into decimal to know the meaning of each parameter. Keep in mind the byte order of the FTMS. When converting the hexadecimal data of each field to the decimal, pay attention to the reading order. The parsing result is as follows.
At this point, the workout data is interpreted. We can see that the user completed 234 meters and consumed 15 kcal of energy in this rowing machine workout. In addition, we can learn about the number and frequency of paddle strokes and the workout time.
By transmitting and interpreting workout data from time to time, we can record and track users' daily workout, helping them manage their health and fitness.
For more about device integration, visit the following website:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/rd-0000001050725868-V5
To learn more, please visit:
HUAWEI Developers official website
Development Guide
Reddit to join developer discussions
GitHub or Gitee to download the demo and sample code
Stack Overflow to solve integration problems
Original Source

can i track overall callories intake?

Related

Marketing Assistant | HUAWEI DTM Helps e-Commerce Apps Quickly Track Marketing Data

Naturally, the main concern for e-commerce companies is the amount of goods and services they sell, and there are many indicators related to this, such as order volume, transaction amounts, and payment conversion rates. These companies also need to be able to compare and analyze these indicators, so that they can find out why certain indicators increase or decrease, and take the necessary measures to improve any shortcomings. Key to all of this is being able to quickly obtain precise marketing data. Marketing teams in e-commerce companies need to update their marketing strategies frequently, and this means they often have to ask the development team to create and implement tracking tags. This takes time and effort, and can cause the marketing team to miss the best time window to market their product, as well as taking up developers' valuable time.
{
"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"
}
Is there a way to track events dynamically without manual coding?
HUAWEI Dynamic Tag Manager (DTM) provides a visual event tracking function which makes tracking events much more efficient. It provides codeless dynamic tag capabilities which enable non-technical personnel to define the events they want to track. This cuts down on communication costs between departments and enables the marketing team to track and analyze data and optimize their strategy accordingly, even if they do not know how to code.
To add a visual event on the DTM portal, all marketing personnel have to do is scan a QR code with their phone. Then, the app screen will be synchronized to the DTM portal, as shown in the screenshot below.
Step 1: Add events to track them visually.
You may want an event to be generated when a user taps the Add to Shopping Cart button on the product details screen. When the user adds a product to their shopping cart, they also select attributes, such as color, version, and memory, and this information will also be reported.
Step 2: Specify the platform to which events are reported and set event parameters.
Step 3: Generate and release a configuration version. This will be automatically delivered by DTM.
Step 4: In AppGallery Connect, go to the HUAWEI Analytics > App debugging, and check that the event has been reported.
Click View details in the Operation column of the event to make sure the event parameters are accurate.
You can also add the visual events in the table below and set relevant event parameters. Click the link for details: https://forums.developer.huawei.com/forumPortal/en/topic/0203428614657600021
Once these events have been added, other relevant events will be reported to the specified analytics platform, such as HUAWEI Analytics, according to the users' action. These events can then be viewed on the analytics platform. DTM supports over 15 analytics platforms, including mainstream analytics platforms like HUAWEI Analytics, HUAWEI Ads, AppsFlyer, Adjust, Google Analytics (Firebase), and Facebook Analytics.
When an e-commerce app uses DTM to track and report events to HUAWEI Analytics, it can reduce the time it takes to track events from 3-4 days to just half a day. What's more, after receiving basic training, non-technical personnel can also manage tracking tags. DTM offers flexible event tracking solutions that can be adapted to different scenarios and requirements. With preset events in DTM, work that usually takes days or even weeks can be completed in just a few minutes.
To learn more about DTM, visit the HUAWEI Developers website.
Does it support to pdf format for downloading reports?
Can't we use the Huawei Analytics Kit to achieve the same result?

How to Quickly Collect the Data You Need from Huge Amounts of Data

What is the most important thing in the big data era? According to Joe Kaeser, the CEO of Siemens, it is data. In his words, "data is the oil, some say the gold, of the 21st century."
Users produce data all the time when they are using mobile phones, tablets, computers, and IoT devices. With data, marketing and sales personnel can quickly analyze the market situation and tailor strategies accordingly. As the basic engine and raw materials for your service, data could help to spur growth.
1. Looking at the current situation of data collection and analysis
Currently, there are two pain points for data collection.
The first is huge waste: The SDK of an analysis platform needs to be integrated for obtaining data. To use different analysis platforms, SDKs of all these platforms need to be integrated, which results in cluttered programs, duplicated monitoring events, and a huge waste of mobile phone resources, such as the computing capability, memory, and network traffic. In fact, only one SDK is enough for collecting data, which will greatly reduce resource waste.
The second is low efficiency: Rapid market changes accelerate the updates and iterations of apps and web pages. Data timeliness is a matter of utmost concern over this trend. The conventional mode of relying on business and IT departments takes a long time, which compromises the data collection efficiency. The data collection efficiency can only be improved through configuring the dynamic tag management rules and visual event tracking, which enables you to collect data in a proactive and code-free manner.
Currently, there are hundreds of self-developed and third-party analysis platforms on the market, and each analysis platform has its own distinct features. It is normal for a company to use multiple analysis platforms, with some suitable for analyzing user behaviors, some for analyzing ad effects, some for analyzing business performance, and some for A/B testing.
How can data be collected efficiently and quickly and sent to multiple analysis platforms?
The answer is HUAWEI Dynamic Tag Manager (DTM), which is about to usher in a new era of data collection and sending.
2. DTM, a flexible and convenient tool
DTM allows people who are not familiar with coding to edit configuration rules (including the data sending time, content, and the analysis platform to which the data is sent) on a web page anytime and anywhere. After that, DTM can quickly obtain the required data and send the data to the specified analysis platforms. Here are some clarifications about what DTM exactly can and cannot do.
l DTM does not generate data. It only collects data.
l DTM collects data easily through rule configuration or visual event tracking, rather than through other labor-intensive methods, such as coding.
l DTM does not analyze data. It only sends data to the analysis platforms as required.
3. How to dynamically and flexibly collect and send data through DTM
{
"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"
}
The preceding figure shows an e-commerce shopping page. If a user taps the button to add a product to their favorites, what can you do to report this event to HUAWEI Analytics Kit?
You only need to configure the configuration rules on the DTM portal page. The rules consist of the following content referred to as the three W's:
When: time when data is sent after an event occurs.
What: attributes and context data of an event.
Where: the analysis platforms that data is sent to, such as Analytics Kit, Google Analytics, and Facebook.
First, you need to configure a condition, which indicates the time when the data is sent. In this example, data sending is triggered when a user taps the button to add a product to their favorites.
You then need to configure the analysis platform and the data to be sent. After that, click Release.
After the configuration is complete, when a user taps the button to add a product to their favorites, a related event will be received by Analytics Kit, and the attributes of the added product, such as the name, color, and version, will also be displayed. If you need to send data to other analysis platforms, you only need to configure an account and parameters for the new platform through DTM.
What is the implementation principle of the preceding configuration?
For an app, you only need to integrate an SDK into the app once and then create configuration rules containing data about the three W's on the DTM portal page. That is, the requirement scheduling, analysis, development, testing, packaging, and release processes are no longer involved. From then on, you can collect data on demand.
It is even easier for a website! You only need to add a piece of JavaScript code on each page of the website and then create configuration rules containing data about the three W's on the DTM portal page.
Compared with the conventional hard coding mode, this mode should be a huge improvement on the data obtaining efficiency. If you still think that it is a little difficult, visual event tracking will help you obtain data more easily.
Visual event tracking allows you to visually add tracking events on the web-based UI by selecting relevant components.
Go to the Visual event page and select the button for adding a product to favorites to add a tracking event for this button. You can also add parameters for the event, such as the product name, color, version, and capacity. Once a user taps this button, this event and relevant data will be reported to the specified analysis platform.
Visual event tracking has the following advantages: 1. Operations personnel can also add tracking events. 2. After the visual event information is updated, no code needs to be modified and no new app version needs to be released. Through visual event tracking, data can be collected in a faster and more cost-effective manner. DTM may currently be the first product on the TMS market that combines the tag management system and visual event tracking together.
More supported user behavior platforms
More dynamic data collection policies
Faster and easier data collection
Flexible connections to multiple analysis platforms
All here for you with DTM
For more details, you can go to:
l Our official website
l Our Development Documentation page, to find the documents you need
l Reddit to join our developer discussion
l GitHub to download demos and sample codes
l Stack Overflow to solve any integration problems
Read In Forum

【Prediction】Mastering HUAWEI Prediction – Serve Users the Smart Way

Low retention and difficult conversion are huge headaches for operations personnel, who often find it difficult to pay for what they have lost. For example, following user churn, the recall rate may not be satisfactory, and costs are high.
Regardless of whether the users can be converted into paying users or eventually be churned, their choice is directly related to their attributes and behaviors in the early stage. Based on such data, HUAWEI Prediction uses AI algorithms to lock users who are likely to churn or pay fees in advance, and then implements targeted measures to extend the user lifecycle and boost the payment conversion rate.
HUAWEI Prediction can help you by: focusing on churn and payment conversion, offering two core operation scenarios, and performing multi-dimensional target audience predictions. It supports multi-touch operations for predicted audience through Push Kit and App Messaging.
This powerful service has drawn acclaim from developers, ever since it was launched. This article shares some key tips that can help you make the most out of HUAWEI Prediction during daily operations.
{
"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"
}
Question 1: What can I do with predicted audience results?
Audience predictions work seamlessly with other growth services provided by AppGallery Connect, such as Push Kit, App Messaging, and Remote Configuration.
For example, you can use Push Kit to push promotional messages, such as new game versions or online gifts to users with a high churn probability, to keep users active and prevent churn. To implement this function, just select your preferred option under Prediction users on the Push Kit page of AppGallery Connect. Likewise, other services, such as Remote Configuration and App Messaging, can also use this method to filter audiences and reach target users.
Question 2: How can I assess the accuracy of prediction results?
The true positive rate and false positive rate displayed on the prediction details page show you an overall prediction result. The true positive rate is the ratio of the number of positive samples correctly predicted by the model to the actual number of positive samples, while the false positive rate is the ratio of the number of negative samples incorrectly predicted by the model to the actual number of negative samples.
For example, in payment prediction, the true positive rate indicates the ratio of paying users correctly predicted by the model to the total paying users. The false positive rate indicates the ratio of the non-paying users incorrectly predicted to be paying users by the model to the total number of non-paying users. The higher the true positive rate, the lower the false positive rate, and the more accurate a prediction result is.
Question 3: Why are prediction tasks unsuccessful after the prediction service is enabled?
This issue relates to the principle behind Prediction. The prerequisite for running a prediction task is that your app reports user attributes and behavior data through HUAWEI Analytics. Therefore, before using Prediction, you'll need to enable HUAWEI Analytics and integrate the HMS Core SDK to ensure that the corresponding user behavior data is reported.
For example, many developers report that payment and return predictions garner no results. This is because results are dependent on whether your app reports payment events. Prediction results can be generated only when sufficient payment events are reported to support prediction model training, for example, the INAPPPURCHASE event.
Question 4: How can I use the custom prediction task?
In addition to the preset churn, payment, and return scenarios, there's a custom prediction task that can help you out in other prediction scenarios. You can specify your prediction task for user behavior based on your specific product operations requirements.
For example, for a game app, operations personnel may focus on the probability that players complete a level. In this case, you can create a custom prediction task by using the game level completion as a target prediction event. For more details, please refer to Customizing a Prediction Task.
This article has provided some answers to frequently asked questions about Prediction. We'll continue to release more articles that delve into the Prediction service. In the meantime, you can also click here to learn more about the service.
To learn more about DTM, click here.
For more details, you can go to:
Reddit to join our developer discussion
GitHub to download demos and sample codes
Stack Overflow to solve any integration problems
Original Source

How Can Dynamic Tag Management Help You in Ad Marketing

Ad marketing typically requires marketers to research users' preferences so that they can deliver suitable ads. This article shows you a simpler way of doing this by quickly obtaining marketing data, and then analyzing users' preferences and adjusting your marketing strategies based on the marketing data.
HUAWEI Dynamic Tag Management (DTM) empowers you to easily obtain and distribute data by configuring rules or adding visual events. With DTM, you can flexibly manage data tags for your app without modifying your app code, dynamically track specified events, and report related data to the specified analytics platform and ad attribution platform.
Now, let's look at how to use DTM through an application scenario. To promote a video app, we usually choose to place ads for the app. In this case, we need to quickly obtain related data to analyze and check the ad effect, and adjust marketing strategies accordingly. The process is as follows.
{
"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"
}
1. Deliver ads.
Marketers select a TV show as the ad asset to deliver ads, encouraging users to download and use the video app.
2. Users tap the ads to download and use the video app.
Once users have tapped the ads and downloaded the app, they can begin watching TV shows that they like through the app. TV shows that users like vary depending on users' preferences. Therefore, marketers must adjust the ad content to align with the types of shows users are interested in, to achieve a better ad effect. This is a key step for ad marketing, and it is one which DTM can help marketers quickly obtain user data for analyzing their preferences.
3. Configure a tag in DTM to report Trace Id, VideoType, and Duration.
Marketers need to define how to handle and report generated events in DTM, of which there are two ways of doing so. One is to add visual events by clicking and selecting related app components. In this way, marketers can dynamically and flexibly track events without modifying the app code. Another way is to configure rules that define when to send data, what data to send, and which platform (where) data is sent to.
When to send data:
What data to send:
Which platform data is sent to:
4. Report data to the specified data analytics platform and ad attribution platform.
If users watch TV shows through the app after they tap the ad and download the app, related data will be automatically obtained and reported to the specified data analytics platform and ad attribution platform based on the configured rules.
5. Analyze the reported data and adjust the marketing strategies.
Marketers can analyze the reported data and adjust the marketing strategies based on the findings, to optimize the ad effect and cut ad costs.
This is just one of DTM's many application scenarios. On top of this, marketers can also use DTM for anti-fraud analysis, helping improve the operations efficiency.
To learn more about DTM, please visit:
>> DTM official website
>> DTM development guide
>> DTM codelab

Mining In-Depth Data Value with the Exploration Capability of HUAWEI Analytics

Recently, Analytics Kit 6.9.0 was released, providing all-new support for the exploration capability. This capability allows you to flexibly configure analysis models and preview analysis reports in real time, for greater and more accessible data insights.
The exploration capability provides three advanced analysis models: funnel analysis, event attribution analysis, and session path analysis. You can immediately view a report after it has been generated and configured, which is much more responsive. Thanks to low-latency and responsive data analysis, you can discover user churns at key conversion steps and links in time, thereby making optimization policies quickly to improve operations efficiency.
I. Funnel analysis: intuitively analyzes the user churn rate in each service step, helping achieve continuous and effective user growth.
By creating funnel analysis for key service processes, you can intuitively analyze and locate service steps with a low conversion rate. High responsiveness and fine-grained conversion cycles help you quickly find service steps with a high user churn rate.
Funnel analysis on the exploration page inherits the original funnel analysis models and allows you to customize conversion cycles by minute, hour, and day, in addition to the original calendar day and session conversion cycles. For example, at the beginning of an e-commerce sales event, you may be more concerned about user conversion in the first several hours or even minutes. In this case, you can customize the conversion cycle to flexibly adjust and view analysis reports in real time, helping analyze user conversion and optimize the event without delay.
{
"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"
}
* Funnel analysis report (for reference only)
Note that the original funnel analysis menu will be removed and your historical funnel analysis reports will be migrated to the exploration page.
II. Attribution analysis: precisely analyzes contribution distribution of each conversion, helping you optimize resource allocation.
Attribution analysis on the exploration page also inherits the original event attribution analysis models. You can flexibly customize target conversion events and to-be-attributed events, as well as select a more suitable attribution model.
For example, when a promotion activity is released, you can usually notify users of the activity information through push messages and in-app popup messages, with the aim of improving user payment conversion. In this case, you can use event attribution analysis to evaluate the conversion contribution of different marketing policies. To do so, you can create an event attribution analysis report with the payment completion event as the target conversion event and the in-app popup message tap event and push message tap event as the to-be-attributed events. With this report, you can view how different marketing policies contribute to product purchases, and thereby optimize your marketing budget allocation.
* Attribution analysis report (for reference only)
Note that the original event attribution analysis menu will be removed. You can view historical event attribution analysis reports on the exploration page.
III. Session path analysis: analyzes user behavior in your app for devising operations methods and optimizing products.
Unlike original session path analysis, session path analysis on the exploration page allows you to select target events and pages to be analyzed, and the event-level path supports customization of the start and end events.
Session path exploration is more specific and focuses on dealing with complex session paths of users in your app. By filtering key events, you can quickly identify session paths with a shorter conversion cycle and those that comply with users' habits, providing you with ideas and direction for optimizing products.
* Session path analysis report (for reference only)
HUAWEI Analytics is a one-stop user behavior analysis platform that presets extensive analysis models and provides more flexible data exploration, meeting more refined operations requirements and creating a superior data operations experience.
To learn more about the exploration capability, visit our official website or check the Analytics Kit development guide.

Categories

Resources