Can't detect iBeacon using AltBeacon / android-beacon-library

I am currently working on a project using an android phone to detect iBeacons and read / write uuid, major minor and other iBeacon information

After searching the web, it seems that AltBeacon / android-beacon-library is recommended for iBeacons detection. However, I cannot find any iBeacons result when I try the code example of the following link: http://altbeacon.github.io/android-beacon-library/samples.html or I run the sample sample app - https: // github.com/AltBeacon/android-beacon-library-reference . I have downloaded an app called Find on Google Play developed by Radius Networks and it also cannot find my iBeacon.

All of the above methods do not display the result of iBeacons. When I try to debug it, functions like didRangeBeaconsInRegion (), didEnterRegion (), didExitRegion () never get called.

However, from logcat I find device information:

10-24 13: 56: 31.878: D / BluetoothAdapter (14042): onScanResult () - Device = 20: CD: 39: 80: 60: F7 RSSI = -70

I tested that my iBeacons should be fine with the app - iBeacon Detector and it can detect my iBeacon.

Am I missing a few steps? Or is this library not suitable for my development? Please comment.

I am brand new to android development and iBeacons, please let me know if you need additional requirement. Thanks for the help.

+3


source to share


2 answers


I'm trying to do what you do. And I also want to use AltBeacon / android-beacon-library, but I haven't done that yet, the answer below is my guess, hope this can give you some hints.

I think your problem might be misuse of the library.

According to the android beacon-library home page http://altbeacon.github.io/android-beacon-library/index.html it says:



By default, it will only detect beacons that conform to the open AltBeacon standard. If you want to configure the library to work with different types of beacons, see the documentation for the BeaconParser class.

iBeacon is a different beacon standard than the AltBeacon open standard used in the Android library beacon, so if you want your application to detect the iBeacon device using the Android library beacon, you need to implement a BeaconParser, which can parser messages. conforming to the iBeacon standard.

+5


source


You basically need to do this:

beaconManager.getBeaconParsers().add(new BeaconParser().
       setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));

      



For more information, see Is this the correct layout for detecting iBeacons with Android Beacon Library from AltBeacon?

0


source







All Articles