4

Currently, I am working on a project using an android phone to detect iBeacons and read/write the uuid, major minor etc information from iBeacon

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

All above ways fail to show the iBeacons result. When I try debug on it, functions like didRangeBeaconsInRegion(), didEnterRegion(), didExitRegion() never be called.

However from logcat I find some device information:

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

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

Did I miss some steps? Or this library is not suitable for my development? Please comment.

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

bill
  • 101
  • 2
  • 9
  • are you sure you beacon works? – njzk2 Oct 24 '14 at 13:45
  • 1
    Thanks for your reply. I think my beacon works. I setup a new beacon layout and the reference application works finally. There are details from another post - [Is this the correct layout to detect iBeacons with AltBeacon's Android Beacon Library?](http://stackoverflow.com/questions/25027983/is-this-the-correct-layout-to-detect-ibeacons-with-altbeacons-android-beacon-li) – bill Oct 25 '14 at 13:18
  • https://play.google.com/store/apps/details?id=de.flurp.beaconscanner.app this app allowed me to detect an iBeacon. – FrankkieNL Mar 30 '17 at 09:11

2 Answers2

7

I'm trying to do the same thing as you did. And I also want to use AltBeacon/android-beacon-library, but I haven't done it yet, answer below is my guess, hope it can give you some clue.

I think your problem might be the misuse of the library.

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

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

iBeacon is a beacon standard different from the open AltBeacon standard used in the Android-beacon-library, so if you want your app using the Android-beacon-library to detect an iBeacon device, you have to implement the BeaconParser which can parser messages conforming to iBeacon standard.

  • Thanks for your reply and that's a great clue. I will try it and update the post later. – bill Oct 25 '14 at 06:39
  • You are correct. All I need to do is just change the layout of beacon. [link](http://altbeacon.github.io/android-beacon-library/javadoc/org/altbeacon/beacon/BeaconParser.html#setBeaconLayout(java.lang.String)) – bill Oct 25 '14 at 13:15
  • 2
    This is correct. Understand that to keep the library open source it cannot be pre-configured to detect proprietary beacon formats. But it is very easy to add a custom `BeaconParser` to decode any proprietary beacon format using a single line of code. Simply do a Google search for "getBeaconParsers" (include the quotes) to see how other folks have done this. – davidgyoung Oct 25 '14 at 13:19
  • @davidgyoung, does this mean that Android beacon library is enough to detect almost all or all beacons from various manufactures ( I'm using smartbeacon and kontakt.io beacon)? – EugenSunic Jan 08 '16 at 17:10
  • 1
    Yes, provided that you supply a BeaconParser for these, which I believe use the proprietary iBeacon format. – davidgyoung Jan 08 '16 at 18:01
1

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, refer to Is this the correct layout to detect iBeacons with AltBeacon's Android Beacon Library?

Community
  • 1
  • 1
Hendy Irawan
  • 20,498
  • 11
  • 103
  • 114