I have written series of articles on Quick App. If you are new to Quick App refer my previous articles.
Quick App set up
A Novice Journey Towards Quick App ( Part 2 )
A Novice Journey Towards Quick App ( Part 3 )
Introduction
Huawei ML kit helps to translate text from one language to another language. You can integrate in 10minutes. Currently, this service supports online translation of text in Simplified Chinese, Traditional Chinese, English, French, Arabic, Thai, Spanish, Turkish, Portuguese, Japanese, German, Italian, Russian, Polish, Malay, Swedish, Finnish, Norwegian, Danish, and Korean. To make use of this feature mobile phone needs the internet.
Follow the steps
Step 1: If you don’t have Huawei developer account Register here
Step 2: Create project (refer Quick App Part 1).
Step 3: Sign in to AppGallery Connect and select My projects.
Step 4: Make sure you select Quick App while adding Add.
Step 5: Select the project which you need to enable the service.
Step 6: Click the manage API tab, Enable ML kit.
{
"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 7: Add the following configuration to the features attribute in the manifest.json file.
Code:
{
"name": "service.ml.translate"
}
Step 8: Add the following configuration to the <script> on the page where the interface will be called.
Code:
import translate from '@service.ml.translate';
Step 9: Make sure you have your app App ID and API Key.
Step 10: Build sample and run the application.
More details, you can check https://forums.developer.huawei.com/forumPortal/en/topic/0203424551508130030
Well explained, very interesting.
Related
More articles like this, you can visit HUAWEI Developer Forum and Medium.
To integrate HMS Account kit in B4A platform we need to follow below steps
Step 1: Follow all the steps mentioned in Basic Setup to start HMS integration on B4A Platform
Refer to https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201286424114350051&fid=0101246461018590361
Step 2: Enable Account Kit in App gallery connect
{
"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 3: Download Account Kit AAR Package from below link
https://github.com/Arkesh-Unity/Account-Kit-in-B4A-Platform/tree/master/Addition
Step 4: Extract and rename the classes.jar --> hwid-4.0.1.300.jar and Androidmanifest.xml -> hwid-4.0.1.300.xml
Step 5: Add hwid-4.0.1.300.jar file to libs
Step 6: get the below marked content from hwid-4.0.1.300.xml and add it to manifest in B4A IDE
Step 7: Create below marked java files
1) Account.java file is used as communicator between B4A and java code
2) AccountAuthWork.java file contains code for Authentication code implementation
3) AccountWork.java file contains code for IdToken implementation
Step 8: Compile and generate B4A library
Step 9: Enable library in B4A IDE
Step 10: Add below code in B4A project to call the methods written for account kit
Refer code : https://github.com/Arkesh-Unity/Account-Kit-in-B4A-Platform
Such an API is not provided in Quick App Specification, but you can obtain the digest value of a file using the third-party library crypto-js.
1. Check whether the third-party library dependency file package.json exists in the quick app project directory. If not, go to NPM > Start Npm Library to start the third-party dependency library in Huawei Quick App IDE. Then, the package.json file is generated.
2. Go to NPM > Npm Install to install the dependency.
3. Switch to the TERMINAL tab page in the IDE console and access the root directory of the quick app project. Run the npm i -S crypto-js command to install the crypto-js library.
{
"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"
}
4. After the installation is complete, the crypto-js dependency is automatically added to the package.json file.
5. The sample code for calculating the digest value of a file in a quick app is as follows:
HTML:
import sha256 from 'crypto-js/sha256';
import MD5 from 'crypto-js/md5';
genSha256: function (e) {
const msg = this.testdata;
this.sha256value = sha256(msg);
},
genMD5: function () {
const msg = this.testdata;
this.md5value = MD5(msg);
},
For more details, please refer to:
development document of crypto.js: https://www.npmjs.com/package/crypto-js
SymptomI have integrated the trial play function provided by the HMS Core Game Service SDK 5.0.1.302 into my game and completed the following as instructed by the official documentation:
Applying to enable the forcible identity verification function.
Adding code snippet for implementing trial play to my game code.
However, when my game was launched and the identity verification pop-up was displayed, the trial play option was not available, which means that the function did not take effect.
AnalysisIt was the first time I integrated the HMS Core SDK, so I contacted Huawei technical support. I was informed of some of the prerequisites for enabling the trial play function:
1. The integrated Game Service SDK version must be 5.0.1 or later.
2. The forcible identity verification has been enabled.
3. Code relating to the trial play function has been added.
4. The default authorization parameter of the game must be DEFAULT_AUTH_REQUEST_PARAM_GAME.
We have met the first three, but not the last one.
{
"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"
}
SolutionFinally, I modified my code by referring to the documentation, and it worked! Hope this post can offer you some help!
Am not sure but check the code for suttle errors
Tennaric said:
Am not sure but check the code for suttle errors
Click to expand...
Click to collapse
this is just a sample code. you can refer to this site to confirm the correct usage. you can even download the sample code in github.
In order to publish an application for China we need to get a Software Copyright Certificate https://forums.developer.huawei.com/forumPortal/en/topic/0203480680985250017
So basically we need to register our application.
Registration site https://ccopyright.com.cn/
First, we need to apply for developer authorization https://register.ccopyright.com.cn/real.html#/realApplyPeople
I am stuck on it, so I have not yet reached the registration of the application.
The site itself is in Chinese, so I use Google Translate for its pages. There is http://www.ccopyright.com/en/, but there is nothing you can find to submit any applications, just a little information in English, limited version.
We can apply for developer authorization using our foreign passport.
But in the registration form there are two items for which we need to upload images (photos) of our documents.
The first item requires two images (the second image is some kind of translation of the document, well, usually foreign passport already have both native language and English version on the same page, so I don't really understand what second image should be, so I just duplicated the photo of my foreign passport twice).
The second item also requires image (third one), I added a photo of my country's national passport)
{
"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"
}
But it didn't work:
The first image was apparently correct (foreign passport), I need to understand what is needed for the second image (some translation, maybe into Chinese) and the third image (second item)
Has anyone tried to register there?
{
"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"
}
Article Introduction
In this article, we will show how import your In-app products from Google Play Console to AppGallery Product management, this will help you to focus on the integration process and facilitate the migration process.
Google File Conversion Tool
This conversion tool provide by HUAWEI AppGallery Connect that will help the developer to quickly reuse in-app product information from Google Play to AppGallery Connect, improving the efficiency of file format and price conversion.
Pre-Requisites
Export your products information from Google play.
Download the Conversion Tool.
Lets Start
My Products information from Google play.
Unzip the Conversion Tool.zip and open Conversion Tool.xlsm .
Click “Enable Content” to let the macros work.
Import your Google products CSV.
Select your“Base price countries”
Click Export!
Conclusion
Conversion tool will facilitate and help the developers to reuse their Google InApp Products, but there are more cases need to be covered such as if the developer want to support multiple currencies and multiple exchange rate.
Tips and Tricks
This tool helps convert only Google files but does not ensure the accuracy of currencies in the Google file and price conversion. So you need to confirm all the converted prices.
The converted price will be rounded up to two decimal places or the nearest integer.
You need to manually enter the product information in the ProductType column
References
Official page of the Conversion tool:
https://developer.huawei.com/consumer/en/doc/distribution/app/agc-help-conversion-tool-0000001164315135
Thank you all.
Original Source