I successfully modified the Android Beacon Library link comparison application using the following beacon layout so that it detects the iBeacon device that I have:
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this); beaconManager.getBeaconParsers().add(new BeaconParser(). setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24")); beaconManager.bind(this); } }
Being new to internal BLE packages, I'm not sure if this is the right layout to use. The library supports the AltBeacon standard, and its documentation does not mention how to detect iBeacon devices.
- Will all iBeacon devices detect this code? that is, the
m: prefix m: too restrictive or is it a right-byte sequence that matches the iBeacon specification? - Similarly, the rest of the layout exactly matches the iBeacon specification?
Link:
- Example iBeacon package mapped to SO
ibeacon-android altbeacon
ento Jul 30 '14 at 2:46 a.m. 2014-07-30 02:46
source share