5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bluetooth Low EnergyAdvent Calendar 2015

Day 6

Android MでBLE使うにはACCESS_COARSE_LOCATIONが必要だよ

Posted at

そういうことです.

image.png (44.0 kB)

BluetoothやWi-Fiのような近傍のデバイスをスキャンする系のAPIは使いようによっては位置情報特定できちゃいますもんね.

To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.

To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions:

  • WifiManager.getScanResults()
  • BluetoothDevice.ACTION_FOUND
  • BluetoothLeScanner.startScan()

Access to Hardware Identifier- Android 6.0 Changes | Android Developers

ということで,Android M(API Level 23)以降はACCESS_COARSE_LOCATIONACCESS_FINE_LOCATIONのpermissionが必要です.

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?