Top Five Points: Support Huawei Mobile Services in Android App

Abdullah Yalcin
Published in
5 min readDec 30, 2022


We all know that nowadays an Android App depends on at least one Google Mobile Service ;)

To distribute the Android Project to Huawei AppGallery, the project must be fully integrated with the HMS (Huawei Mobile Services) APIs. Although Huawei makes things easier by providing documents and tools to achieve this integration, but various infrastructure and configurations are required for those who will do it for the first time.

Here we will cover the points you will encounter, you can already find the official details at

1. AppGallery Connect

As in the Google Play Console, you must first create a Huawei Console account. Here’s an identity verification system that takes a few business days. It is impossible to proceed without waiting for the verification to be complete.

After gaining access to the account, you must create a project and a linked app in AppGallery. You have to enter the package name and credentials of the Android Project in the same way.

After you are done, you can manage the required API permissions and analytics reviews of the project.

2. API Activations

Just like in Firebase, Huawei offers various APIs such as PushKit, Remote Configuration, Analytics, Location, and Map. When adding Huawei support to your project, it will be important to configure them the same as Google services. For example, you should add the Remote Config parameters appropriately or you should support the backend environment, you made with Firebase Push Notification, for PushKit.

Even if there is no need for many changes on the Android coding side. It would be useful to review Huawei Documents while configuring the API.

3. HMS Toolkit

HMS Toolkit is an assistant tool that offers convertor, analysis, configuration, and examples that you can use on Android Studio. After installation, you must connect to your account via the Configuration Wizard. You must provide the kits, the project uses, and a certificate. To create a new certificate or use your existing certificate, you can read the article published on the Huawei Medium page.

Then you can start the process to add HMS support with the Convertor tool. Here, if your project includes multi-module support or is a library, tick the appropriate options.

4. Converting Strategies

Huawei offers us two main conversion policies as Add HMS API(G+H) and To HMS API(G2H).

  • Add HMS API(G+H), which includes Google and Huawei services on top of the project, enabling the device to choose according to its support at runtime.
  • To HMS API(G2H), connects the project to HMS services by arranging it to use only Huawei services.

If the G+H policy is selected, it creates an interconnection layer by adding the module called xmsAdapter to the project. Thanks to the generic data types contained in this layer, access to service classes is provided.

HMS Convertor Overview

5. Analyzing and Converting

At this stage, there is an area where you can see the GMSs used in the project and their support.

The Add HMS API policy I mentioned above is divided into options such as HMS API First or GMS API First. This means that if the device has support for both sides, which one will it choose first?

In the Convertible methods section, if you have complex API uses, you will probably need to make manual edits. These changes are usually minor changes to a function, such as a return type modification, or changing an unsupported function call.

For example in my project, since the interface type we sent as a listener remained from the GMS class, it had to be replaced with the type defined in xmsAdapter.


After automatic and manual conversion, you can build your project and distribute it in Huawei AppGallery. Remember, Huawei has a large device ecosystem and you may want to get your share of the market.

Even though processes such as identity verification take time, thanks to HMS Toolkit, you get away from a lot of boilerplate code. Two important points I came across are;

  • API Activation, you must provide one-to-one configuration and support for the services you previously created at Google to work with HMS in the same way.
  • Manual Changes, although this topic may seem annoying at first, Huawei offers many one-to-one API support. I think you will easily find alternative functions.

I hope this topic saves you time. When you have something to say, you can reach me on LinkedIn or wherever you find me :)