Search code examples
androidandroid-ble

Is BLE scan will work in tablets which does not have GPS chip?


I am working in BLE apps. I have some doubts in GPS permission to perform BLE scanning.

  1. Is BLE scan will work in tablets which do not have GPS chip?
  2. startLescan() will work without GPS permission?

Solution

  • BLE has absolutely nothing with GPS. Here's a detailed explanation: https://developer.android.com/guide/topics/connectivity/bluetooth-le

    You may need to declare the following permissions:

    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    
    <!-- If your app targets Android 9 or lower, you can declare
         ACCESS_COARSE_LOCATION instead. -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    

    NOTE: while the GPS is not actually used, you have to declare ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION for things to work properly since the beacons are often used to provide location information.