Skip to content

Instantly share code, notes, and snippets.

@dermatthias
Last active March 19, 2024 20:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dermatthias/29af809b4f57b245765a to your computer and use it in GitHub Desktop.
Save dermatthias/29af809b4f57b245765a to your computer and use it in GitHub Desktop.
Parse Eddystone URL with Android Beacon Library
// m:2-2=10 for scanning for URL frames (00 = UID, 20 = TLM)
BeaconParser eddystoneURLBeaconParser = new BeaconParser().setBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-13,i:14-19");
beaconManager.getBeaconParsers().add(eddystoneURLBeaconParser);
//....(search for beacons with didRangeBeaconsInRegion() etc.)
String url = new String(beacon.getId1().toByteArray(), "UTF-8");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment