public class BluetoothUtils
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
REQUEST_CODE_BLUETOOTH |
static int |
REQUEST_CODE_GPS |
| 构造器和说明 |
|---|
BluetoothUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
closeBluetooth()
关闭蓝牙
|
static boolean |
isOpenBluetooth()
蓝牙是否开启
|
static boolean |
isOpenGPS(android.content.Context context)
判断是否启动 GPS 定位服务
|
static boolean |
isSupportBluetooth()
是否支持蓝牙
|
static boolean |
openBluetooth()
强制开启蓝牙
|
static void |
openBluetooth(android.app.Activity activity,
int requestCode)
开启蓝牙,如果强制打开蓝牙失败,请再次调用这个方法转到系统设置页面开启
|
static void |
openGps(android.app.Activity activity,
int requestCode)
打开 Gps 系统设置页面
|
static void |
openPermissionsSetting(android.app.Activity activity)
打开系统权限设备页面
|
public static final int REQUEST_CODE_GPS
public static final int REQUEST_CODE_BLUETOOTH
public static boolean isOpenGPS(android.content.Context context)
context - contextpublic static void openGps(android.app.Activity activity,
int requestCode)
activity - requestCode - 请传入 REQUEST_CODE_GPS 常量public static boolean isSupportBluetooth()
public static boolean isOpenBluetooth()
public static boolean openBluetooth()
public static void openBluetooth(android.app.Activity activity,
int requestCode)
activity - requestCode - 请传入 REQUEST_CODE_BLUETOOTH 常量public static boolean closeBluetooth()
public static void openPermissionsSetting(android.app.Activity activity)
activity -