How to create an emulator implemented with emui - android

I have an application that depends on google services, i did too much migration in order to let the new Huawei phones run my application.
Unfortunately i couldn't test my application on emulator due to HMS core is missing, i have created a new Stock android image and i tried to install HMS core APK but the app could not be installed as the image ,
Unfortunately cloud debugging not serving me due to the huge services. and i need to see everything step by step. any solution expect that i buy a new phone without google services?

You can try HMS plugin
Go to File-> Setting-> Plugins and search for HMS Toolkit and install it.
Visit the article HMS Toolkit - Automatic HMS SDK Integration To know detail about HMS installation and usage.
Once you select debugging and choose devices you can select EMUI version from there.

If you are using kits that do not depend on Huawei phones, such as Push Kit, ML Kit, Scan Kit, and In-App Purchases, you can download HUAWEI AppGallery on a non-Huawei phone and then run your app. In this case, you will be automatically guided to download and install HMS Core (APK) on AppGallery. You can also use the adb command to manually install HMS Core (APK) and then run your app for testing. For details, please refer to EMUI Version-Dependent Features.
If you are using kits that depend on Huawei phones, such as FIDO, Map Kit, and Health Kit, you can use Cloud Debugging to debug apps. (Cloud Debugging cannot debug code step by step.)
Work with Cloud Debugging at https://stackoverflow.com/a/63877454/14006527.

we can use android emulator before that you need to download latest HMS Core APK install into your emulator, all HMS kits doesn't supports. better you can go with cloud debugging or Install Hms plugin in your android studio use cloud debugging.

Related

Can a Flutter app be proposed on the Huawei AppGallery?

Some Huawei mobile devices don't have the Google Play Store and have the Huawei AppGallery instead. Since Flutter is for cross-platform development (iOS and Android), it may be desirable to propose Flutter developed apps through the Huawei AppGallery.
The Huawei devices without the Google Play Store are still using Android and the applications to upload to the Huawei AppGallery must have the apk extension (just like in the Google Play Store). These are hunches that at least some Google Play Store applications can be proposed on the Huawei AppGallery. However, I did not find any proof or confirmation of this. Nor any clear perimeter for this compatibility. For example, some services may not work or may not be accepted on the Huawei AppGallery for technical or legal reasons. One part of this perimeter is the use of Flutter to develop the application.
So, my question is, can a Flutter developed application be compatible with the Huawei AppGallery and if so, under which conditions?
Edit after first app publication 2020 04 13
My first Flutter app has just been published on the Huawei AppGallery. This answers the first part of the question.
Still, as this app is quite minimalist, this doesn't answer the most important part which is: under which conditions can a Flutter app be published on the Huawei AppGallery?
As long as your application complies with the regulations of AppGallery, there should not be any problem it.
https://developer.huawei.com/consumer/en/doc/30202
AppGallery does not have any restriction on the language application developed with, no need to worry about it; flutter, cordova, react.native, xamarin they are fine.
Just a point to take care. If you are using SDKs or services those depend on Google Play services, when you have published your application on AppGallery, it will be visible only for Huawei devices supports Google Play Services.
There are no restrictions on the Flutter apps. They can be released on HUAWEI AppGallery.
How to release an app:
Register and sign in to your HUAWEI Developer account, go to AppGallery Connect, create a new app, and upload the APK.
Set languages and basic app information, such as app name, introduction, screenshots, and app category.
Select your business model (free or premium), release countries and regions, and a link to the privacy statement.
Confirm that all of the information provided is correct, and submit your app for review.
As #captaink said, please also refer to AppGallery Review Guidelines.
If your app has integrated GMS Kit, these capabilities provided via GMS are not available on Huawei phones with HMS. If you want your app to run on these phones, integrate Huawei Mobile Services (HMS).
Huawei has provided some HMS Core kit plugins for Flutter. They have been published to public open source communities. You can also find them on GitHub.
Account Kit plugins for Flutter
Ads Kit plugins for Flutter
Analytics Kit plugins for Flutter
AR Kit plugin for Flutter
In-App Purchases Kit plugin for Flutter
Location Kit plugins for Flutter
Map Kit plugins for Flutter
Push Kit plugins for Flutter
Scan Kit plugin for Flutter
Site Kit plugins for Flutter
In theory, yes it could. Huawei uses an OS called Harmony OS.
The Arc compiler in Harmony OS supports all the major programming languages including C/, C++, Java, JavaScript and Kotlin.
Flutter compiles Dart code to native device code (Java, and Kotlin for Android and Swift for iOS). Huawei is making an Arc compiler that supposedly makes it easy to turn Android apps to Harmony OS apps. What does this mean for Flutter and the AppGallery? I'm not sure.
So to your question, in theory, yes it could but I would just recommend coding your own app in one of the languages mentioned above and using the Arc compiler to put it on Huawei's AppGallery.
UPDATE:
So apparently you can just put an APK on the Huawei App Gallery: https://developer.huawei.com/consumer/en/doc/distribution/app/30204. Since you can obviously make APKs in Flutter, I don't see why not.
Update on this subject:
we received the communication from Huawei technical staff to delete all Google Play Services in the app and substitute them with theirs Huawei Mobile Services, before the end of November 2020.
It seems that after this date they don't accept Google Play Services inside the apps. Don't know if app published before will still be there after.

App requires latest version of ARCore. Google Play Services for AR says my device isn't compatible with this version

What steps do I need to take when I have troubles trying to use an app I created and try to run it on the latest Samsung Tab A 10.1? I tried to start the app, the message displayed is :
This application requires the latest version of ARCore
So I tapped the continue button. I was taken to Google Play. The title says "Google Play Services for AR". Then below that it says:
Your device isn't compatible with this version
Does anyone have a solution, please?
Firstly check whether the device you are using has the ARCore support:
It was indeed an easy experience in terms of building and running the app on the IOS device, iPhone 10. There were no complications in activating the ARkit in the devices since they were built in like the documentation mentioned. It was particularly gruesome in building the AR app on an Android device. As per the documentation the Android devices such as Samsung Galaxy A70S is compatible with ARCore.
Firstly the app simply crashed on installing into the device
As a part of the workaround, I looked for installing, "Google Play Services for AR" on my play store which simply didn't show up
I directly tried to install the app "Google Play Services for AR" through google but it failed with the message, the app is not compatible with my device.
I did a trial and error with installing the "Google Play Services for AR" apk directly from https://www.apkmirror.com/apk/google-inc/arcore/, specifically https://www.apkmirror.com/apk/google-inc/arcore/arcore-1-13-19100710-release/google-play-services-for-ar-1-13-191007106-android-apk-download/ to my Android device to enable ARCore which supported 64-bit processor
The app was however still crashing due to the 403 forbidden IP error on persisting the data
The issue got resolved on adding my public IP to azure rules

Google play services problems in emulator [duplicate]

For the emulator I have below, I am getting the error message that "Google Play Services not installed on the device".
As per the developer site, it says that 'The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
Not able to understand if the emulator is running 4.4.2 then why is google play services not present?
Some related threads, but no resolution. (adding these just to point out this issue is not a duplicate):
Related Thread
Related Thread
http://developer.android.com/google/play-services/setup.html
Quoting docs
If you want to test your app on the emulator, expand the directory for
Android 4.2.2 (API 17) or a higher version, select Google APIs, and
install it. Then create a new AVD with Google APIs as the platform
target.
Needs Emulator of Google API"S
See the target in the snap
Snap
I prefer testing on a real device which has google play services installed
You will not able to test the app using the Google-Play-Service library in emulator. In order to test that app in emulator you need to install some system framework in your emulator to make it work.
https://stackoverflow.com/a/11213598/1405008
Refer the above answer to install Google play service on your emulator.
If you happen to not have the image, download it via the SDK manager:
If you're using Xamarin, I found a guide on their official forum explaining how to do this:
Download the package from the internet. There are many sources for this, one possible source is the CyanogenMod web site.
Start up the Android Player and unlock it.
Drag and drop the zip file that you downloaded onto the Android Player.
Restart the Android Player.
Hereafter, you might also need to update the Google Play Services from the Google Play Store.
Hope this helps for anyone else who has troubles finding the documentation.
Setp 1 :
Download the following apk files.
1)com.google.android.gms.apk (https://androidfilehost.com/?fid=95916177934534438)
2)com.android.vending-4.4.22.apk (https://androidfilehost.com/?fid=23203820527945795)
Step 2 : Create a new AVD without the google API's
Step 3 : Run the AVD (Start the emulator)
Step 4 : Install the downloaded apks using adb .
1)adb install com.google.android.gms-6.7.76_\(1745988-038\)-6776038-minAPI9.apk
2)adb install com.android.vending-4.4.22.apk
adb come up with android sdks/studio
Step 5 : Create the application in google developer console
Step 6 : Configure the api key in your Androidmanifest.xml and google api version.
Note :
In step1 you need to download the apk based on your Android API level(..18,19,21..) and google play services version (5,5.1,6,6.5......)
This will work 100%.
google play service is just a library to create application but in order to use application that use google play service library , you need to install google play in your emulator.and for that it need the unique device id. and device id is only on the real device not have on emulator. so for testing it , you need real android device.

How to test In-app Billing on an emulator?

Is it possible to disable in-app billing/purchase and test my application on an Android Emulator? I want to do some functional testing of my application on multiple emulators.
Later on I would test the 'in-app billing' on a real device.
Anyone have experience?
How should I do this?
From Google:
http://developer.android.com/guide/market/billing/billing_testing.html
To test in-app billing in an application you must install the
application on an Android-powered device. You cannot use the Android
emulator to test in-app billing. The device you use for testing must
run a standard version of the Android 1.6 or later platform (API level
4 or higher), and have the most current version of the Android Market
application installed.
Update 2022
Recently re-checked:
Even if we Emulate a system-image which targets Google-Play (instead of Google APIs),
update Google-play services to latest,
and follow the "Goole Wallet" app's and/or "Google Pay" app's add-credit-card form till end successfully.
Said App instead of adding credit-card as payment-method, just shows message:
Note that the message is confusing, as we were trying to add credit-card, and did not try to use "Tap to Pay".
Install an emulator that has already google playstore installed, on a system image that supports google service api
My emulator spec:
Pixel 3a API 31
ABI: x86_64
System image: Android API 31 (Google Play)
Create a closed testing track in google playstore console
Add your gmail to license testing and closed testing email list
Wait for your closed testing to be approved and available for testers.
If you're using an existing emulator, please wipe data and cold boot
Login as a tester account in gmail app as the first thing when you launch the emulator
Browse closed testing invitation url, and accept invitation to take part in closed testing track
IMPORTANT Make sure you're using the same application id (e.g. com.your.company.app), version code (e.g. 1.3.0) and version name(a.k.a build number) as the closed testing binary.
That's all. Test payments in the emulator.
For step 2 ~ 4 you can refer to this wonderful doc from revenue cat: https://docs.revenuecat.com/docs/google-play-store

Google Play Services Missing in Emulator (Android 4.4.2)

For the emulator I have below, I am getting the error message that "Google Play Services not installed on the device".
As per the developer site, it says that 'The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
Not able to understand if the emulator is running 4.4.2 then why is google play services not present?
Some related threads, but no resolution. (adding these just to point out this issue is not a duplicate):
Related Thread
Related Thread
http://developer.android.com/google/play-services/setup.html
Quoting docs
If you want to test your app on the emulator, expand the directory for
Android 4.2.2 (API 17) or a higher version, select Google APIs, and
install it. Then create a new AVD with Google APIs as the platform
target.
Needs Emulator of Google API"S
See the target in the snap
Snap
I prefer testing on a real device which has google play services installed
You will not able to test the app using the Google-Play-Service library in emulator. In order to test that app in emulator you need to install some system framework in your emulator to make it work.
https://stackoverflow.com/a/11213598/1405008
Refer the above answer to install Google play service on your emulator.
If you happen to not have the image, download it via the SDK manager:
If you're using Xamarin, I found a guide on their official forum explaining how to do this:
Download the package from the internet. There are many sources for this, one possible source is the CyanogenMod web site.
Start up the Android Player and unlock it.
Drag and drop the zip file that you downloaded onto the Android Player.
Restart the Android Player.
Hereafter, you might also need to update the Google Play Services from the Google Play Store.
Hope this helps for anyone else who has troubles finding the documentation.
Setp 1 :
Download the following apk files.
1)com.google.android.gms.apk (https://androidfilehost.com/?fid=95916177934534438)
2)com.android.vending-4.4.22.apk (https://androidfilehost.com/?fid=23203820527945795)
Step 2 : Create a new AVD without the google API's
Step 3 : Run the AVD (Start the emulator)
Step 4 : Install the downloaded apks using adb .
1)adb install com.google.android.gms-6.7.76_\(1745988-038\)-6776038-minAPI9.apk
2)adb install com.android.vending-4.4.22.apk
adb come up with android sdks/studio
Step 5 : Create the application in google developer console
Step 6 : Configure the api key in your Androidmanifest.xml and google api version.
Note :
In step1 you need to download the apk based on your Android API level(..18,19,21..) and google play services version (5,5.1,6,6.5......)
This will work 100%.
google play service is just a library to create application but in order to use application that use google play service library , you need to install google play in your emulator.and for that it need the unique device id. and device id is only on the real device not have on emulator. so for testing it , you need real android device.

Categories

Resources