Can't use huawei mobile services on the new Huawei devices - android

I'm developing an android project.I want to integrate Huawei mobile services for Huawei devices without google play services. in this project I have developed but when I test it for Huawei P40 in cloud debugging environment, Huawei mobile services don't work.It works when i test it on Huawei mate 10 pro.Huawei mobile services location kit not reacting at p40. How can i solve this please help me

Update:
I got the following message in Logcat. Message is; I/Last Location:
Last location is null!
Please check whether getLastLocation obtains location information from the system cache. If it does, the obtained location is null when the system cache has been cleared. In this case, call requestLocationUpdates to cache the current location. Then, you can obtain the location information by calling getLastLocation.
Here is the HMS Core Location Kit demo on github here. Please update to the latest version :)
Please ensure that the location permission has been assigned to the HMS Core app. Go to Settings > Apps > Apps and find the HMS Core app. (The menu path may vary depending on the operating system version. If you cannot find the app, tap the menu icon in the upper right corner of Apps and tap Show system processes.) Then, tap the HMS Core icon, go to App info > Permissions > Location, and verify that the location permission is assigned to HMS Core.
You probably cannot use the high-precision location service as it is currently supported only on HUAWEI P40 series and is available only in the Chinese mainland.
Activity identification and geofence are not supported on emulators.
If the error persists, please provide us with logs of the fault.
You can perform the following operations to capture the logs:
1). Run the following command to connect to the device
adb logcat –v time > D:\hwlocation.log
2). Reproduce the fault.
3).Press Ctrl+C.
In addition, record the device model, EMUI version, HMS Core version, integrated SDK version, and fault reproduction procedure so that technical personnel can help you quickly troubleshoot the fault.

Related

HMS Site kit not working in some devices with error code 6004

tested with Honor 9A its showing error code 6(we have encoded the api key).
tested with huawei nova 7i (emui 10.1.0)its showing error code 6004--we have enabled api properly and cleaned cache
same apk working fine with Cloud debigging
same apk working fine with Honor 9X pro ,version 9.1.1
You must enable site kit service in your Huawei developer account.
Navigate to Project Setting > General information and click your app.
Navigate to Manage API and Enable Site kit.
Suggestion:
Check whether the current app has been created and has applied for related services.
Check whether the application package name is correctly configured in the Manifest file.
Clear the Huawei Core(APK) cache and try again.
If the fault persists, contact Huawei technical support.
Reference: https://developer.huawei.com/consumer/en/doc/development/HMS-2-References/hmssdk_jointOper_api_reference_errorcode
Issue is seen in only two devices.
The possible causes are as follows: checkPermission result: 6004
I can see from CPs logs has API access permission issue , it is getting ErrorCode: 6004.
Please can you clear Cache the HMS core apk and restart your phone to accept Service Agreement popup and install apk again.

Android Virtual Device for Huawei Mobile Services

I want to apply HMS to my app. However, buying an actual Huawei phone is not on my shortlist. Does Huawei provide an Android Virtual Device for that purpose? If not, how to test if my implementation of HMS actually works?
Yes, Huawei do provide an Android Virtual Device called Cloud Debugging of AppGallery Connect to test your app for Huawei Devices.
Cloud Debugging tests your app using mainstream Huawei devices provided by Huawei. You can run your app on the latest and most popular Huawei devices to test app functions. Besides, you can debug apps on two real devices at the same time using one HUAWEI ID. Assume that you have applied for a device successfully.
Work with Cloud Debugging
Sign in to AppGallery Connect and select My projects.
Select an app to be tested.
Go to Quality > Cloud Debugging.
Filter devices by Series, Android version, EMUI version, and Resolution.
In the Apply for device model dialog box that is displayed, set Debug duration based on your needs. The options are 30 min, 1 h, and 2 h.
Wait for the device initialization to finish.
Click the Debugging tab.
Click Upload to upload an APK.
Check the APK upload progress and install the APK after the upload is complete.
In the displayed dialog box indicating that the app is being installed, click OK. When the installation is complete, you can see the app icon on the device screen on the left.
Operate the device by moving or clicking your cursor on the device screen, or clicking the power button, home button, menu button, or back button. The device will respond like your own phone.
Check Screenshot below:
From: https://stackoverflow.com/a/63389096/13329100
If you don't have HMS device your side you can run HMS Application in three ways.
1. Huawei Cloud Debugging in App Gallery: In this method first we have to sign in App Gallery. You can see the article "Efficient integration of HMS open capabilities by using HUAWEI Cloud Debugging solution" for the step by step process of cloud debugging.
2. Cloud debugging through HMS ToolKit: Here first we have to install HMS Tool Kit plugin in Android Studio.You can use the article "Debug your application on any HMS Supported Model using HMS Toolkit Cloud Debugger - No Real Device Required" for step by step process.
3. Installing HMS Core App in your non HMS Device: You can install HMS Core app in your non HMS device. Once install it will ask to update the app. This will help you to run some Kits like awareness, ML, Ad etc in your device. Once we install we have to go to Settings->Apps and search for 'HMS Core'and grant the location or other permissions which are required.
Hope any of these method will help you.

Is there any effective way to test an app for the Huawei Store using Android Studio emulator?

I would like to know if there is any effective way to test an app for Huawei Store using an Android Studio emulator.
I tried disabling the Google Play Services, but for some reason Retrofit requests stopped working :/
You can use Cloud Debugging of AppGallery Connect to test your app for Huawei Devices.
Cloud Debugging tests your app using mainstream Huawei devices provided by Huawei. You can run your app on the latest and most popular Huawei devices to test app functions.
Work with Cloud Debugging
Sign in to AppGallery Connect and select My projects.
Select an app to be tested.
Go to Quality > Cloud Debugging.
Filter devices by Series, Android version, EMUI version, and Resolution.
In the Apply for device model dialog box that is displayed, set Debug duration based on your needs. The options are 30 min, 1 h, and 2 h.
Wait for the device initialization to finish.
Click the Debugging tab.
Click Upload to upload an APK.
Check the APK upload progress and install the APK after the upload is complete.
In the displayed dialog box indicating that the app is being installed, click OK. When the installation is complete, you can see the app icon on the device screen on the left.
Operate the device by moving or clicking your cursor on the device screen, or clicking the power button, home button, menu button, or back button. The device will respond like your own phone.
Check Screenshot below:
You can check out the official documentation for a more complete answer.
For most cases, you can simply grab HMS Core APK and install it on emulator or physical device
You do not need for most cases Huawei device. Here is my battle-tested solution.
If you're implementing HMS (Huawei Mobile Services) feature like push notifications, sms retrieving or auth(orization) you can do simply:
Grab HMS Core APK from: https://www.huaweicentral.com/download-the-latest-huawei-mobile-services-apk/
Create new or run existing Android emulator via Android Studio or ADB
Install HMS Core APK downloaded from 1.
Go to Settings -> Apps & Notifications
Make sure that HMS Core has required permissions like SMS for SMS retrieving or push notifications
If you forget about 5., HMS library will return exception "Permissions not enabled"
I am pretty sure that instead of emulator you can use any of physical devices, grab APK and install HMS Core on it.
From: https://stackoverflow.com/a/63790263/4730812
Happy coding!
Well, I was trying here to make Retrofit work in this condition and I found a way.
I don't know if it is the best solution, but I will post it anyway.
disable the Google Play Services;
force stop your app;
restart the emulator;
check if it is working now (if not, try to force stop your app again).
P.S.: Google Play Services is not re-enabled upon reboot.

When HMS Core is outdated an error is returned

If HMS Core is outdated an error -1 core error is returned when calling
IapClient.isEnvReady()
There is a possibility to disable automatic update of the HMS Core. At some point, when it is outdated, if an app is started and there is a call to IapClient it always returns -1 core error. When HMS Core is updated and a device is restarted, then performing calls to IapClient works fine.
Is there any possibility to get meaningful error and, maybe, get an intent to update HMS Core?
The method IapClient.isEnvReady() is to check whether the currently signed-in HUAWEI ID is located in a location where HUAWEI IAP is available. If your HUAWEI ID is located in the suppported locations, the check will pass.
In Addition, if HMS Core version of the test device is too low, the app will automatically call a pop-up asking the user whether to update HMS Core Apk.
Thanks

Has anyone successfully converted an Android app using GPS over to Blackberry PlayBook using the Eclipse plugin

I have tried converting my functional android app that uses GPS over to the Playbook and it compiles, loads, and runs on the device, but hangs trying to access the GPS. I have figured out that there should be a user prompt displayed asking for permission to access the GPS location, but it never appears. I am using the android permission "android.permission.ACCESS_FINE_LOCATION" and have tried coarse also, but I cannot get that user prompt to show up. Also, the app is not listed in settings >> security >> application permissions.
GPS does work on the device with other apps and I am NOT using Google Maps API's
Has anyone successfully done this with GPS, and if so, what permissions or work-arounds did you have to use.
Thanks
If you're side-loading the app onto the device you don't get the prompt about permissions, nor will your app appear in the Security->Application Permissions section. See this thread for details.
Can't blame you for giving up on the Playbook though - it's a complete pain to develop on, as are all the other BlackBerry platforms!

Categories

Resources