gps打开接口
2015-03-27 11:31
85 查看
android判断gps是否打开的接口:
android中打开gps的接口:
同时需要<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>权限
public boolean isGpsOpen(Context context) { return Settings.Secure.isLocationProviderEnabled(context.getContentResolver(), android.location.LocationManager.GPS_PROVIDER); }
android中打开gps的接口:
同时需要<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>权限
public static void enableGps(Context context, boolean enable) { try { Settings.Secure.setLocationProviderEnabled(context.getContentResolver(), LocationManager.GPS_PROVIDER, enable); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
相关文章推荐
- Android中如何打开或关闭GPS
- Android判断GPS是否开启和强制帮用户打开GPS
- Android 打开 GPS 导航并获取位置信息
- Restorator 导致win8或win8.1 打开程序提示不支持此接口的解决方法
- 基于android 的GPS 移植——主要结构体及接口介绍
- Android打开或者关闭GPS
- WTL 通过IWebBrowser2接口使WebBrowser控件在自己的窗口打开网页
- GUI接口的制作-打开图像
- 使用微博API(nearby timeline接口)搜集含GPS新浪微博数据
- 做一个GPSCar类,要求继承Car类,并实现GPS接口
- Android打开系统GPS设置页面代码
- GPS打开失败
- 判断接口是否已经打开并运行
- 如何利用ArcGIS Engine接口实现打开Raster Catalog中的某一幅指定的影像?
- Android判断GPS是否开启和强制帮用户打开GPS
- 自动打开微信接口
- Android 直接打开Gps,不需要用户操作
- android 打开GPS的几种方式
- 打开editor的接口讨论
- Android中如何通过程序打开或关闭GPS