您的位置:首页 > 编程语言 > Go语言

google Map 在手机上是否可以使用的判断

2017-01-11 09:27 155 查看

int flg = MapsInitializer.initialize(mContext);

 出现Google Play服务不可用的错误时,可以使用GoogleApiAvailability.getInstance().getErrorDialog()弹出官方提供的对话框,这会根据不同的错误代码来给用户提供不同的操作,比如是进行升级操作还是下载操作。

GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(),
ApiClientActivity.this, 0).show();


public static final int SUCCESS = 0;
public static final int SERVICE_MISSING = 1;
public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2;
public static final int SERVICE_DISABLED = 3;
public static final int SIGN_IN_REQUIRED = 4;
public static final int INVALID_ACCOUNT = 5;
public static final int RESOLUTION_REQUIRED = 6;
public static final int NETWORK_ERROR = 7;
public static final int INTERNAL_ERROR = 8;
public static final int SERVICE_INVALID = 9;
public static final int DEVELOPER_ERROR = 10;
public static final int LICENSE_CHECK_FAILED = 11;
public static final int CANCELED = 13;
public static final int TIMEOUT = 14;
public static final int INTERRUPTED = 15;
public static final int API_UNAVAILABLE = 16;
public static final int SIGN_IN_FAILED = 17;
public static final int SERVICE_UPDATING = 18;
public static final int SERVICE_MISSING_PERMISSION = 19;
public static final int RESTRICTED_PROFILE = 20;


google官网都是支持AS开发,所以很容易上手,本人本次使用的是eclipse开发,千辛万苦在网上找到jar,不如AS那么顺利,用eclipse开发纯属闲的蛋疼了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: