如何检查是否在设备中启用了Google移动服务? [英] How to check Google Mobile Services enable in device or not?

查看:105
本文介绍了如何检查是否在设备中启用了Google移动服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须检查Google服务是否在设备上处于活动状态.我该如何检查?看起来只玩服务就足够了吗?

I have to check if google services are active on the device. How can I check it? Looking just play services is enough?

我需要这张支票以获取华为服务.

I need this check for Huawei services.

推荐答案

您可以使用以下代码进行检查:

You can use these codes to check:

boolean flag = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == com.google.android.gms.common.ConnectionResult.SUCCESS

如果 flag == true ,则在设备中启用GMS.

If flag == true, then GMS is enable in device.

如果 flag == false ,则在设备中禁用了GMS.

If flag == false, then GMS is disable in device.

这篇关于如何检查是否在设备中启用了Google移动服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆