We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
공식 문서 참고
위 내용을 보면 안드로이드에서 블루투스를 사용하기 위해서는 두 가지 권한이 필요하다고 나온다.
첫 째, 위치 권한. 위치 권한에는 두 종류가 있다. coarse(대략적인 위치), fine(정확한 위치) 그렇다면 왜 위치 권한을 필요한가? 블루투스 스캔을 사용하여 사용자의 위치 정보를 수집할 수 있다. 사용자의 기기에서 외부에 위치 정보를 제공하거나, 블루투스 비콘(근거리 무선 통신 기술)의 위치 정보를 사용자의 기기로 얻어오기 위해서 위칙 권한이 필요하다. 쉽게 생각하면, 블루투스 통신을 통해서 사용자 혹은 외부의 위치 정보를 얻어오는 경우가 있기 때문에 위치 권한이 필요하다는 것이다.
첫 째, 위치 권한. 위치 권한에는 두 종류가 있다. coarse(대략적인 위치), fine(정확한 위치)
둘 째, 블루투스 권한. BLUETOOTH, BLUETOOTH_ADMIN 권한이 필요하다. 블루투스를 사용하기 위해 당연히 블루투스 권한이 필요하겠지?
둘 째, 블루투스 권한.
The text was updated successfully, but these errors were encountered:
private void scanLeDevice(final boolean enable) { if (enable) { handler.postDelayed(new Runnable() { @Override public void run() { mScanning = false; bluetoothAdapter.stopLeScan(leScanCallback); } }, SCAN_PERIOD); // SCAN_PERIOD 시간 만큼 딜레이 Log.d("Bluetooth scan", "Scanning"); mScanning = true; bluetoothAdapter.startLeScan(leScanCallback); } else { mScanning = false; bluetoothAdapter.stopLeScan(leScanCallback); } }
private BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) { runOnUiThread(new Runnable() { @Override public void run() { // 스캔 된 블루투스 기기 처리 } }); } };
BLE scan
위치 권한
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> <uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
위 과정을 통해 확실한 결과를 얻었다. 안드로이드에서 블루투스를 사용하기 위해서는 위치 권한이 필수로 필요하다.
Sorry, something went wrong.
No branches or pull requests
Android Bluetooth는 왜 ?
정리
공식 문서 참고
위 내용을 보면 안드로이드에서 블루투스를 사용하기 위해서는 두 가지 권한이 필요하다고 나온다.
The text was updated successfully, but these errors were encountered: