-1

I want to get the major & minor values and the battery level as well as the proximity UUID, but I'm not sure how to get those values from Beacon object. It doesn't seem there are the functions to get them. Could you provide the sample code to get those values from Beacon object?

shenhai99
  • 1
  • 1

1 Answers1

0

When using the iBeacon layout:

beacon.getId1().toString();   // ProximityUUID
beacon.getId2().toInt;        // major
beacon.getId3().toInt();      // minor 

The battery level is not present with the iBeacon layout. With some hardware manufacturers, it is available if you configure the beacon to transmit he AltBeacon layout. In that case you may be able to use:

beacon.getDataFields().get(0); // battery level
davidgyoung
  • 63,876
  • 14
  • 121
  • 204