What google services are banned in Harmony OS (here is a list that I have used in my android app.)

偶尔善良 提交于 2021-01-15 06:35:30

问题


I need to upload my android apk file in harmony os and as google services are banned in this platform, I would have to use the alternative platform. Here is a list of google services that I have used. Please help me to distinguish what google services would I need to override and recode for Harmony OS.

com.google.android.material
com.google.firebase
com.google.android.gms:play-services-auth
com.google.android.gms:play-services-maps
com.google.android.gms:play-services-location
com.google.android.libraries.places
com.google.code.gson
com.google.protobuf.nano:protobuf-javanano

回答1:


  1. Your app has integrated GMS. As new Huawei phones are banned from using GMS, you app, if with GMS integrated, will be unable to run on new Huawei phones. If you want your app to run on these phones, integrate Huawei Mobile Services (HMS).

If you want to use the map service in your app, and also want your app to run on both Huawei phones and Google Android phones, you can integrate both GMS Map Kit and HMS Map Kit. Then your app will use HMS Map Kit on Huawei phones, while using GMS Map Kit on Google Android phones.

In the list you provided, you use these GMS services:

com.google.firebase
com.google.android.gms:play-services-auth
com.google.android.gms:play-services-maps
com.google.android.gms:play-services-location
com.google.android.libraries.places

You can refer to the following Huawei mobile services:

Account Kit, Map Kit, Location Kit, Site Kit, AppGallery Connect auth service

  1. You can use this IDE plug-in called HMS Core Toolkit to help you analyze where GMS is used in your code. HMS Core Toolkit supports analysis of manual conversion, aiming to increase the conversion efficiency. It provides two conversion policies: Add HMS API and To HMS API. You can choose one as required.
  • Choose HMS > Convertor > New Conversion to start scanning, analysis, and conversion.

The Convertor is a code conversion tool supporting Java and Kotlin projects. This tool can help you quickly convert the existing Android app code for calling third-party APIs into the app code integrated with the HMS Core.

New Conversion can automatically convert the GMS APIs called by apps into HMS APIs, using either the To HMS API or Add HMS API conversion policy.

  1. Upload your app through AppGallery Connect.
  • How to How to create and release your app on HUAWEI Developer?
  1. Register and create your app: Register and sign in to your HUAWEI Developer account, go to AppGallery Connect, create a new app, and upload the APK.
  2. Set basic information: Set languages and basic app information, such as app name, introduction, screenshots, and app category.
  3. Set release information: Select your business model (free or premium), release countries and regions, and a link to the privacy statement.
  4. Submit for release: Confirm that all of the information provided is correct, and submit your app for review.



回答2:


Huawei phones are Android, not Harmony OS. However Huawei wearables are running on Harmony OS, which is not compatible with Android, so your APK will not work in this case. You will need to rewrite your app from scratch for Harmony OS.

From the list your provided, these use Google Mobile Services:

  • com.google.firebase
  • com.google.android.gms:play-services-auth
  • com.google.android.gms:play-services-maps
  • com.google.android.gms:play-services-location
  • com.google.android.libraries.places

You have alternatives for each one through HMS Core. There are some wrapper libraries made by third parties, for example for maps and location, that make this migration easier.



来源:https://stackoverflow.com/questions/63336006/what-google-services-are-banned-in-harmony-os-here-is-a-list-that-i-have-used-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!