问题
I am looking for a tested working example code of android app that creates a virtual beacon and starts advertising it. Ive tested already couple of tutorials/examples but without success. My target environment is Android 7 on Galaxy S7.
Appreciate your help.
!
回答1:
There is a transmitter section on the Android Beacon Library sample page here:
http://altbeacon.github.io/android-beacon-library/samples.html
Two tips to making this work so it is detectable by another app.
- Set the proper BeaconLayout of the beacon type you want to transmit. You can see the beacon layout strings for various beacon types here:
https://beaconlayout.wordpress.com
- If you want to transmit iBeacon make sure you set the company code to that of Apple (0x004c) so it is recognized as an Apple iBeacon format.
来源:https://stackoverflow.com/questions/46868465/working-ibeacon-ble-beacon-app-code-example