How to programmatically set UUID, major ID, … and other properties at 1m in Altbeacon format

纵然是瞬间 提交于 2019-12-12 07:04:33

问题


I am currently exploring retail advertising options. I am interested in AltBeacon as it is an open standard. I have a basic question, if someone can answer

How can I programmatically set UUID, major ID, minor ID, advertisements frequency, broadcasting power and RSSI at 1m in Altbeacon format on both (i) IOS devices and (ii) Android devices?

As Locate App is taking these values as variables from users, I guess they are inputting these values programmatically?!


回答1:


If you wan to know how to do this with the Android Beacon Library, this is explained on the sample code page

 Beacon beacon = new Beacon.Builder()
    .setId1("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6")
    .setId2("1")
    .setId3("2")
    .setManufacturer(0x0118)
    .setTxPower(-59)
    .setDataFields(Arrays.asList(new Long[] {0l}))
    .build();
 BeaconParser beaconParser = new BeaconParser()
    .setBeaconLayout("m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25");
 BeaconTransmitter beaconTransmitter = new BeaconTransmitter(getApplicationContext(), beaconParser);
 beaconTransmitter.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);
 beaconTransmitter.setAdvertiseTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);
 beaconTransmitter.startAdvertising(beacon);


来源:https://stackoverflow.com/questions/52049493/how-to-programmatically-set-uuid-major-id-and-other-properties-at-1m-in-al

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!