android BLE device scan and connect manager, this library
You will need the following permissions to access the Bluetooth Hardware
android.permission.BLUETOOTH
android.permission.BLUETOOTH_ADMIN
if SDK >= 23, add permission
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
- Tidy up Javadoc. There is quite a lot of it that is template
- Add parsers for common Ad Records.
- Can not scan any device(SDK >= 21), link
//
private boolean checkLocationPermission() {
return checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION) || checkPermission(Manifest.permission.ACCESS_FINE_LOCATION);
}
private boolean checkPermission(final String permission) {
return ContextCompat.checkSelfPermission(mContext, permission) == PackageManager.PERMISSION_GRANTED;
}
public static boolean isGpsProviderEnabled(Context context){
LocationManager service = (LocationManager) context.getSystemService(context.LOCATION_SERVICE);
return service.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
- open or close log: BleManager.getInstance().setLogDebugMode(BuildConfig.DEBUG);