<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
LOLLIPOP之後的要使用startScan();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mBluetoothAdapter.startScan(); } else { mBluetoothAdapter.startLeScan(mLeScanCallback); }
沒有留言:
張貼留言