1

Does anyone know the best way to detect Bluetooth LE advertisements on a Android device? I need to only retrieve the service UUID and RSSI value from the advertisement packet, I don't need to connect with the device--If this makes a difference. Do I need to use one of the vendor specific Bluetooth API's like Broadcom for a device that contains a Broadcom bluetooth module?

CaseyG
  • 115
  • 3
  • 6
  • Hi, did you figure out how to retrieve service UUID from scanRecord advertising packet.I am using a iOS device as peripheral which is broadcasting the data + service UUID.I want to get the service UUID from the discover callback. – androidGuy Dec 03 '13 at 12:32
  • @androidGuy here you can find the answer to your first question: http://stackoverflow.com/questions/18019161/startlescan-with-128-bit-uuids-doesnt-work-on-native-android-ble-implementation – Andrea Motto Mar 20 '14 at 00:36

2 Answers2

0

As of Android version 4.2, the Broadcom stack has been integrated into Android and will work out of the box. Prior to that you needed to run another stack to give BLE access, as stock Android had no APIs.

TJD
  • 11,349
  • 1
  • 22
  • 32
  • I've tried using the normal startDiscovery() method on my Nexus 7 running Android version 4.2 and it is not discovering my BLE devices. Could you please provide some pointers and info on what device you got it working for? Appreciate the help. – CaseyG Mar 23 '13 at 19:33
0

As of SDK 18 Android now has APIs for this. However, in my testing they do not work properly on the Nexus 4 with 4.3.

See documentation here: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html

Nick Palmer
  • 2,230
  • 1
  • 18
  • 30
  • Nexus 4 only provides the first scan record per device, which is the standard setting in iOS by the way. The work around for Nexus 4 right now is to stop and start LE-scan after each package. The BLE SDK of Android 4.3 works good for scanning, but nothing else ;) See http://stackoverflow.com/questions/17870189/android-4-3-bluetooth-low-energy-unstable – OneWorld Aug 08 '13 at 07:57