ReactiveBeacons icon indicating copy to clipboard operation
ReactiveBeacons copied to clipboard

iBeacon UUID and Eddystone UID

Open doubl3p opened this issue 7 years ago • 5 comments

where can i get:

  • iBeacon UUID
  • Eddystone UID

It would be very helpful.

doubl3p avatar Feb 16 '17 21:02 doubl3p

You can try this method:

ParcelUuid[] uuids = beacon.device.getUuids();

Beacon class has public final device field of type BluetoothDevice.

Reference in Android SDK documentation: https://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#getUuids()

pwittchen avatar Feb 16 '17 21:02 pwittchen

thanks for the fast reply. sadly it's not what i am searching for:

ParcelUuid[] uuids = beacon.device.getUuids(); don't returns the:

  • iBeacon UUID like: 2f234454-cf6d-4a0f-adf2-f4911ba9ffa6
  • Eddystone UID-Namespace like: 0x2f234454f4911ba9ffa6

and let my application terminate.

beacon.device.toString(); also retuns just the MAC-Address.

doubl3p avatar Feb 16 '17 22:02 doubl3p

After the quick search, I found out that it's not possible to get iBeacon UUID and Eddystone UID just with Android SDK easily. Probably it could be somehow extracted or translated from uuids or scanRecord field in Beacon class. Unfortunately, I don't know how to do that yet. I suppose it may be a custom functionality, which require additional implementation. When I gather more concrete knowledge in this topic, I'll post an update here.

I'm also open for help and suggestions of the other people.

pwittchen avatar Feb 16 '17 22:02 pwittchen

here in this lib:
https://altbeacon.github.io/android-beacon-library/distance-triggering.html they define a BeaconManager and use BeaconParser to define how to parse the Advertising packet. here e.g. iBeacon format.

beaconManager = BeaconManager.getInstanceForApplication(this); beaconManager.getBeaconParsers().add(new BeaconParser() .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24")); beaconManager.bind(this);

doubl3p avatar Feb 17 '17 12:02 doubl3p

Initial references (code snippets), which can help in the implementation:

iBeacon:

https://github.com/inthepocket/ibeacon-scanner-android/blob/32e286cd67bfd97255f62f5d470db67921877c34/ibeaconscanner/src/main/java/mobi/inthepocket/android/beacons/ibeaconscanner/ScannerScanCallback.java

Eddystone:

https://github.com/google/eddystone/blob/master/tools/gatt-config/android/BeaconConfig/app/src/main/java/com/github/google/beaconfig/BeaconScanData.java

pwittchen avatar Apr 14 '17 20:04 pwittchen