【问题标题】:How to check if chinese android device haves compatibility with Google APIs?如何检查中文 android 设备是否与 Google API 兼容?
【发布时间】:2014-08-31 07:20:55
【问题描述】:

一些中国安卓设备不兼容谷歌API,例如谷歌地图。

如果您尝试在这些设备中安装使用 google 地图的应用程序,该设备将不允许您安装它,并且这些应用程序在此设备的 google play 上不可见。

是否有办法检查设备是否与官方 google api 兼容?

谢谢

【问题讨论】:

    标签: android google-maps google-api


    【解决方案1】:

    Google 地图和其他一些 google api 是 Google Play 服务的一部分。

    您必须检查设备以了解已安装 Play 服务 apk 并更新到您在应用中使用的版本。

    private boolean checkGooglePlayServices() {
        int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        switch (resultCode) {
        case ConnectionResult.SUCCESS:
            return true;
        case ConnectionResult.SERVICE_DISABLED:
        case ConnectionResult.SERVICE_INVALID:
        case ConnectionResult.SERVICE_MISSING:
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return false;
        }
        return false;
    }
    

    【讨论】:

    • google play services apk 无法安装在我的 vexia 平板电脑上,因为 vexia 平板电脑不支持 google apis....您可以从市场上的 google 安装官方 google maps 应用程序,但是使用地图视图的应用无法在此平板电脑上运行...
    • @AndroidUser99:此代码不需要 Play Services APK。它需要 Play Services 库项目,该项目会编译到您的应用程序中。它检查是否安装了 Play Services APK。
    • 好的,但是如果您不使用播放服务库会发生什么?没有那个库就无法满足我的需求吗?
    猜你喜欢
    • 2021-04-02
    • 1970-01-01
    • 2012-11-26
    • 2018-12-30
    • 1970-01-01
    • 2023-04-01
    • 2011-02-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多