Android Mastering the Integration: Coexisting Google and Huawei Mobile Services in a Single???

Hello dear Android developers, today I will give you information about using HMS and GMS libraries over a single code base. We will also make an example of using Google Maps and Huawei Map Kit in the same project as an example. If you’re ready, let’s start!

First of all, we need to add our dependencies to our project.

We need to add our dependencies to our project.

Then we need to create our related functions that check whether the services of GMS and HMS are active on our phone.

Checks if Google Services is available on our phone.

Checks if Huawei Services is available on our phone.

According to the true and false values returned from the above functions, we can decide which services will work on our phone or not. Now we will try our functions only on phones with Google services and only Huawei services.

Read More