ReactiveBeacons
ReactiveBeacons copied to clipboard
iBeacon UUID and Eddystone UID
where can i get:
- iBeacon UUID
- Eddystone UID
It would be very helpful.
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()
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.
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.
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);
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