Android Mastering the Integration: Coexisting Google and Huawei Mobile Services in a Single…
<p>Hello dear Android developers, today I will give you information about <strong>using HMS and GMS libraries over a single code base</strong>. We will also make an example of using <strong>Google Maps and Huawei Map Kit in the same project</strong> as an example. If you’re ready, let’s start!</p>
<p>First of all, we need to <strong>add our dependencies to our project.</strong></p>
<p><iframe frameborder="0" height="433" scrolling="no" src="https://medium.com/media/9663b297c1a4ffee8de8104ce383ad04" title="a.gradle" width="680"></iframe></p>
<p><strong>We need to add our dependencies to our project.</strong></p>
<p>Then we need to create our related functions that <strong>check whether the services of GMS and HMS are active on our phone.</strong></p>
<p><iframe frameborder="0" height="172" scrolling="no" src="https://medium.com/media/905455118a9642fb8063ad9298d0b3e7" title="b.kt" width="680"></iframe></p>
<p><strong>Checks if Google Services is available on our phone.</strong></p>
<p><iframe frameborder="0" height="172" scrolling="no" src="https://medium.com/media/a7e5ad90c217b7de7819074566d2ed90" title="a.kt" width="680"></iframe></p>
<p><strong>Checks if Huawei Services is available on our phone.</strong></p>
<p>According to the <strong>true and false values returned from the above functions</strong>, we can decide <strong>which services will work on our phone or not. </strong>Now we will try our functions <strong>only on phones with Google services</strong> and <strong>only Huawei services.</strong></p>
<p><a href="https://medium.com/huawei-developers/android-mastering-the-integration-coexisting-google-and-huawei-mobile-services-in-a-single-f7df1d116452">Read More</a></p>