Q: Is Huawei Map is charging on per call transactions charges?
A: Huawei Map is free of charge, Huawei is not charging any additional charges for any developer to using Huawei Map on their applications.
Q: There are two buttons at the top of the app page for displaying two maps. Click the button to display the Huawei map. Set a location on the map and click the enable button. The app crashes.
A: The lateinit variable is specified in the code. The enable operation is performed without the Map being completely loaded. As a result, the variable is used before being initialized. As a result, an exception is reported.
Essential cause: The Hwawei map needs to be loaded and displayed. Do not add markers during the loading process. Otherwise, exceptions may occur.
Q: After the integration is completed based on the development document, the fence notification message does not trigger callback. Geofence verification uses simulated locations.
A: The fence uses low-level positioning information, and does not support simulated positions. Analysis of the code shows that the use of broadcasts is not registered in the manifest. After the broadcast is registered, the callback is still not triggered. Then, the problem is caused by repeated app installation. Restart the phone to resolve the problem. The geo-fencing is triggered successfully, and the notification message is displayed properly.
Related
Contact Shield is a basic contact diagnosis service developed based on the Bluetooth low energy (BLE) technology. Global public health institutions can authorize developers to develop COVID-19 contact diagnosis apps using Contact Shield APIs. These apps can interact with other devices while protecting user privacy to check whether a user has been in contact with a person tested positive for COVID-19. If so, the user will be notified and instructed to take relevant measures, effectively controlling the spread of the virus.
Working Principles
1. The mobile phone of B broadcasts the DSC (Dynamic Sharing Code). The phone can generate a DSC collection based on the periodic key on each day, select a DSC based on the current time, and broadcast the DSC to surrounding devices through BLE.
2. The mobile phone of A receives the DSC broadcast by B. After scanning the DSC broadcast by the mobile phone of B, the mobile phone of A records the current timestamp and received signal strength indicator (RSSI), and stores the data in a local database.
3. If B is diagnosed as a COVID-19 patient, the app obtains authorization from B and uploads the periodic key within the virus incubation period (14 days by default) to the app server or the server specified by a public health institution. In this case, the periodic key of B is called the shared key.
4. The app of A periodically downloads the compressed package of periodic keys of the diagnosed user from the server and calls Contact Shield to perform contact diagnosis. Contact Shield deduces the DSC collection broadcast by the diagnosed person based on the periodic keys provided by the app.
5. During contact diagnosis, Contact Shield uses the DSC collection generated in 4 to match a record in the DSC data table of the last 14 days stored in the local database. After the matching is complete, Contact Shield generates a diagnosis report and notifies A of the contact diagnosis result through the app.
Based on the diagnosis report, A knows whether he or she has been in close contact with the diagnosed user and the potential contact risk level.
When the Contact Shield invokes the interface, the error code -1 is returned. There are many possible causes in this scenario. This section describes the troubleshooting procedure for this error code.
\Note: If the error code -1 is displayed, view the error log and search for the keyword HmsNearbyKit_sdk_ContactApiImpl. Generally, the log contains an error code with the actual error cause.
1. Developer have not applied for the Contact Shield permission (Error code 6004).
Cause 1:
Unlike other HMS SDKs, the Contact Shield SDK requires developers to send related information through emails to grant permissions.
For details about how to apply for the contact guard API permission, see:
https://developer.huawei.com/consum...equest-access-0000001058448610?ha_source=hms1
Cause 2:
The agconnect-services.json file in the local project does not match.
Check whether the agconnect-services.json file added to the local project is the same as the required agconnect-services.json file.
You can download the new agconnect-services.json file from the AGC official website and commission the project again.
For details about how to download the agconnect-services.json file, see:https://developer.huawei.com/consum...-integratesdk-0000001058897058?ha_source=hms1
2. The generated APK signature file (.keystore or .jks file) is different from the SHA-256 information configured on the AGC. (Error code 6003).
The APK signature file must be the same as the signature configured on the AGC.
The configuration procedure is as follows:
https://developer.huawei.com/consum...ld-config-agc-0000001057648627?ha_source=hms1
3. When the API is invoked for the first time, the mobile phone is not connected to the network.
When the contact guard API is invoked for the first time, if the mobile phone is not connected to the network, the error code -1 is returned.
In this scenario, ensure that the network connection is normal and invoke the Contact Shield API again.
4. After the startContactShield() interface is invoked, the pop-up message is manually canceled.After the startContactShield() interface is invoked, the following dialog box is displayed.
User must select Allow to invoke the Contact Shield API.
Note: The error code in the latest Contact Shield has been updated to 8015.
5. User do not have the location permission of the HMS Core APK.When the startContactShield() interface is invoked, in addition to the pop-up for point 4, the dialog box shown in the following figure is displayed if you do not have the location permission.
User must select “ALLOW ALL THE TIME”to invoke the Contact Shield API.
Note: The error code in the latest Contact Shield has been updated to 8103.
To view the permission, choose Settings > Apps > Apps > Search HMS Core > Permissions > location.
6. When the putSharedKeyFiles() interface is invoked, the file format provided by the developer is incorrect.When the putSharedKeyFiles interface of the Contact Shield is invoked, the transferred file in List<File> files is incorrect.
The format and generation method of this file are the same as those in Google's Exposure Notifications.
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
Original Source
Introduction
People take their mobile devices wherever they go. Mobile devices have become a necessity in people's daily routines, whether it be for looking at the weather forecast, browsing news, hailing a taxi, navigating, or recording data from a workout. All these activities are so much associated with the location services on mobile devices.
With the location awareness capability offered by HarmonyOS, mobile devices will be able to obtain real-time, accurate location data. Building location awareness into your application can also lead to a better contextual experience for application users.
Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording.
Working Principles
Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis.
Limitations and Constraints
Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application.
Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information.
Obtaining Device Location Information
Create View Layout
The view that we will do is very simple, we will only add four buttons to represent the request for the location of the device in with the different options that the system provides.
Countinue to Orignal Source..
ProManojKumar said:
Introduction
People take their mobile devices wherever they go. Mobile devices have become a necessity in people's daily routines, whether it be for looking at the weather forecast, browsing news, hailing a taxi, navigating, or recording data from a workout. All these activities are so much associated with the location services on mobile devices.
With the location awareness capability offered by HarmonyOS, mobile devices will be able to obtain real-time, accurate location data. Building location awareness into your application can also lead to a better contextual experience for application users.
Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording.
Working Principles
Location awareness is offered by the system as a basic service for applications. Depending on the service scenario, an application needs to initiate a location request to the system and stop the location request when the service scenario ends. In this process, the system reports the location information to the application on a real-time basis.
Limitations and Constraints
Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application.
Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information.
Obtaining Device Location Information
Create View Layout
The view that we will do is very simple, we will only add four buttons to represent the request for the location of the device in with the different options that the system provides.
Countinue to Orignal Source..
Click to expand...
Click to collapse
is there any limitation?
Description
A white screen is displayed when a user opens an app.
Cause Analysis
You are advised to analyze the problem from the following aspects:
1. Check whether the route configuration is correct and whether the user is redirected to the expected target page.
2. Check whether the data request API is called.
3. Check whether the callback returns data.
4. Check whether values are assigned to page data and whether bidirectional binding is correct.
5. Check whether the result of the show and if statements is correct.
Solution
1. After the page is modified (for example, the page name is changed or a page is created), check whether the route table is updated synchronously and whether the routes are correctly configured. In addition, modify the route table, switch to the hello word page, and check whether the hello word page is displayed properly.
2. Check whether the page lifecycle function onInit is confused with the app lifecycle function onCreate. If onCreate is used on the page and the data request API is called in onCreate, the API will not be actually executed. To solve this problem, cal the API in onInit instead.
3. The parameters called by the data request API are incorrect, leading to no data callback. Or the fail branch is not processed, leading to no processing of callback data. In both scenarios, no data is obtained. To locate the cause, record logs for subsequent queries after the API is called back.
4. The data returned by the fetch request is a character string, which needs to be converted into JSON data through JSON.parse. You need to check whether the returned result is empty. Otherwise, an error is reported. In addition, pay attention to this in the asynchronous request during API calling to ensure that the value is successfully assigned.
5. You may use show and if to display the page if data is requested and hide the page if no data is requested. In this case, ensure that show and if are correctly set.
Suggestions and Summary
If a problem occurs, you are advised to go to the page, and then check the lifecycle, data obtaining, and value assignment in sequence to locate the problem.
The Health app collects statistics on various sensors, which depend on the hardware of the phone.
Android is implemented on top of the bottom layer. The hardware layer implementation varies with vendors, and the power saving mode varies with vendors. Therefore, it is difficult to collect data on multi-vendor devices.
Most of the Sports Health Apps want to be able to collect statistics on sports data in the background.
[Background keep-alive]: To make step count more accurate, the app wants to collect the user step count for a long time. The app wants to keep the user step count in the background of different brands of phones (live keep-alive) and continuously collect sensor data. However, the system may kill the user step count. As a result, the count is inaccurate.
Solution 1: HMS Integration Solution
If the data required by users is supported by Huawei HiHealth or Health Kit, the HMS can be integrated to solve the problem. Huawei HiHealth and Health kits can be used in the background of Huawei phones for a long time.
Huawei Push is integrated. The Push function can be used to receive messages when the app process is not running. CPs that have the requirement of pushing messages can be guided to access Push messages, for example, Eyecon.
Solution 2: Guide manual settings
Set manual instructions in the app to guide users to manually set keepalive (close battery optimization and allow background running).
Multiple Pedometer Apps have such settings, such as winwalk and sweatcoin.
You can get data from Huawei Health Kit.
Very useful thanks for sharing!
HMS Core Health Kit unlocks atomic data for developers. After obtaining user consent, your app will then be able to read, add, modify, or delete users' health and activity data by calling Health Kit APIs. To begin with, you will need to first apply for test scopes from Health Kit, to access this data before your app is released. Here I have listed some problems that I have encountered during the application, as well as their solutions. I hope you find this helpful.
After I send an application to Health Kit, how long will it take for my application to be reviewed?The review takes about 15 workdays, and you will be notified of the result via SMS and email. If your application is rejected, modify your materials according to the feedback, and then submit your application again. The second review will take another 15 working days. Please check your materials carefully so that your application can pass the review as soon as possible.
Can I apply for accessing Health Kit as an individual developer?According to the privacy policy, individual developers can apply for accessing Health Kit to read/write basic user data (such as step count, calories, and distance) if your app is intended for short-term research, development, and testing purposes. But please note the following:
During application, you have to specify when your project or testing ends. Relevant personnel will revoke the scopes in due time.
You do not have access to advanced user data (such as heart rate, sleep, blood pressure, blood glucose, SpO2, and other health data).
After your application and personal credit investigations have been reviewed, only the first 100 users will be able to access the Health Kit service that your app integrates.
This restriction cannot be removed by applying for verification.
This can only be removed by applying for the HUAWEI ID service again, registering as an enterprise developer, and then applying for Health Kit service.
What is different between the data scopes opened to enterprise developers and individual developers?The following lists the respective data scopes available for individual and enterprise developers.
Individual developers: height, weight, step count, distance, calories, medium- and high-intensity, altitude, activity record summary, activity record details (speed, cadence, exercise heart rate, altitude, running form, jump, power, and resistance), personal information (gender, date of birth, height, and weight) and real-time activity data.
Enterprise developers: In addition to the basic data scopes opened to individual developers, enterprise developers also have access to location data and the following advanced data: heart rate, stress, sleep, blood glucose, blood pressure, SpO2, body temperature, ECG, VO2 max, reproductive health, real-time heart data, and device information.
What are the requirements for enterprise developers to access Health Kit?If you only apply for accessing basic user data, the paid-up capital of your company must be larger than or equal to CNY 1 million; if you apply for accessing advanced user data, the paid-up capital of your company must be larger than or equal to CNY 5 million. What's more, Huawei will take your company's year of establishment and associated risks into consideration.
If you have any questions, contact [email protected] for assistance.
What are the requirements for filling in the application materials?Specific requirements are as follows:
Fill in every sheet marked with "Mandatory".
In the Data Usage sheet, specify each data read/write scope you are going to apply for, and make sure that these scopes are the same as the actual scopes to be displayed and granted by users in your app.
What does it mean if the applicant is inconsistent?The developer name used for real-name verification on HUAWEI Developers must be the same as that of the entity operating the app. Please verify that the developer name is consistent when applying for the test scopes. Otherwise, your application will be rejected.
What should I do if my application was rejected because of incorrect logo usage?Make sure that your app uses the Huawei Health logo in compliance with HUAWEI Health Guideline. You can click here to download the guideline and the logo in PNG format.
Please stay tuned for the latest HUAWEI Developers news and download the latest resources.
Why can't I find user data after my application has been approved?Due to data caching, do not perform the test until 24 hours after the test scopes have been granted.
If the problem persists, troubleshoot by referring to Error Code.
ReferencesHMS Core Health Kit
Development Guide
More FAQs About Accessing Health Kit