Cannot detect iBeacon using AltBeacon/android-beacon-library - android

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.

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.

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?

Related

BLE mesh Android

I want to implement BLE mesh in Android and researched about it. And I found few libraries named STMicroelectronics and Nordic. But I am not able to find clear documentation of these. Also they have mentioned some hardware compatibility. What I want exactly is to implement BLE mesh by using one Android phone as a client and other Android phones as BLE devices (using BLE simulator app).
Can you please tell me if this is possible? If yes, which library should I use and where can I get proper step by step documentation for integration.

How to scan ibeacons using cordova-plugin-ibeacon?

I am using petermetz/cordova-plugin-ibeacon in my hybrid application, plan to deploy it on Android devices only.
I have seen application that detect beacons placed nearby, and i want to achieve same functionality but using cordova plugin in my hybrid app.
Can some one help in detecting ibeacons present nearby with their details like their UUID as the sample given doesn't explains much about scanning.
Thanks,
Rohit
Simply follow the example on the README of the page linked in the question for "Start ranging a single iBeacon", and replace the major and minor field values with null. This will scan for all beacons with the UUID specified.
It is not possible to use the plugin to scan for all beacons regardless of UUID because iOS does not allow this.

How to detect IBeacon in android without using any library

i am new to Ibeacon and i want to know can we detect Ibeacon in android without using any SDKLibrary or library can any one give sample example.
i know some library like Radius Networks. but i don't want to use any library
The Android OS does not have any code that detects iBeacons, but it does have code that allows you to scan for Bluetooth LE devices, which are a lower-level device than an iBeacon.
You can roll-your own code that detects iBeacons using this Bluetooth LE scanning. That's exactly what the Android iBeacon Library from Radius Networks does. It is open source, so if you don't want to use the library, you can simply copy blocks of code out of the library and do your own detection.
The source code is here: https://github.com/RadiusNetworks/android-ibeacon-service
EDIT: the library has been moved to http://github.com/AltBeacon/android-beacon-library
If you detection use cases are very simple, this might work fine. Be careful not to bite off too much work, though, because handling all the edge cases can become increasingly complex. That's certainly what I learned when writing the library.
If you just want to play with this, I would focus on one class from the library: IBeacon.java
This class can convert from an Android Blueooth LE scan record to an IBeacon (if the scanned Bluetooth device is indeed an iBeacon)
You can read about how to set up Bluetooth LE scanning on Android here: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
There is a new small library: https://github.com/inthepocket/ibeacon-scanner-android
Without a library it's very easy to scan for ibeacons, you just need to create the correct ScanFilter, based on the iBeacon, and then start a BLE scan. Creating the correct ScanFilter can be hard at first, best have a look at the code in the mentioned library.
Dependant on Android version, location needs to be turned on, location permission needs to be granted and bluetooth, always, needs to be on.

Is it possible to use a BLE enabled Android/iPhone as a BLE beacon?

I'm working on a BLE proximity sensing feature based on Android and need some information.
Currently I see there are no BLE beacons manufacturers for android. I found 2 so far for iPhone.
1) http://www.estimote.com
2) http://www.gimbal.com
Estimote claims that their devices are generic but mainly they are publicized for iBeacons. So I'm not sure whether I should order them for a feature on Android.
Secondly gimbal explicitly mentions that their devices won't be enabled for android for proximity sensing.
So if any of you know where can I order BLE beacons compatible with Android please let me know.
Another thing, for prototype testing I was wondering whether I could use a Android BLE capable tablet or smartphone as a beacon to emit BLE signals?
Till now the documentation for android only suggests how to detect a beacon, But I'm not sure whether an Android device can be used as a beacon.
Any insights?
There is a BLE Beacon manufacturer for Android: Radius Networks
You can detect any standard iBeacon on Android using our Android iBeacon Library.
You can try it out yourself with our free iBeacon Locate app, which is based on this library. My company also sells both software and hardware iBeacons that I guarantee work with Android. But again, any standard iBeacon will work, too. Don't take my word for it -- just download our free app and use it to see one of our iBeacons. (We even have a free virtual machine you can use!)
It is currently not possible to make an iBeacon out of a stock Android device because the Bluetooth LE APIs, introduced in Android 4.3, do not support the peripheral mode needed to transmit advertisements like an iBeacon.
EDIT: It is now possible to make rooted Android 4.4.3 devices transmit as an iBeacon. See here.
I tried simple BLE scan app on Android, but the callback for LeDevices always returned null for UUID[]. Also, finding based on know UUID didnot work.
To add to David's reply. I have tried Radius Networks SDK, pretty clean. I like it.
Also, Estimotes has released their Android SDK today(1/7), which is good. The sample App shows notification, Distance, Major-Minor. I tested with 3 Estimotes & also with iPhone's app (making the iPhone as iBeacon). It works well, give it a try.
Note that you have to modify the code
change the ESTIMOTE_PROXIMITY_UUID value to the UUID that you are watching for.
Hope it helps.

Combine iBeacon bluetooth low energy with Android 4.3

I'm looking for a way to detect iBeacon (iOS 7.0 feature) from an Android device. I read the Android documentation, where it seem that the iBeacon is some kind of GATT server which sends its position. While the Android documentation says that I should not poll that data, but for the detection this would be nessesary.
I google a lot but this topic is quite new (I even created a new tag ibeacon) so I would be happy if I get some links to ressources from the iOS world which descripes the implementation. Also if there are some Android libs which I did not find yet would be nice.
EDIT: The library below has been moved here:
https://github.com/AltBeacon/android-beacon-library
I have ported the iOS7 iBeacon SDKs to Android, and was able to see standard iBeacons and estimate their range. The code is available here:
https://github.com/RadiusNetworks/android-ibeacon-service
For this to work, you need Android 4.3 which introduced the Low Energy Bluetooth APIs. You also need a device with a low energy bluetooth chipset.
If you don't want to use the full library above, you can roll your own. iBeacons simply transmit a BLE advertisement once per second that start with a known sequence of bytes. You simply have to tell Android to do a BLE scan, get each advertisement, and look for one that starts with the known iBeacon byte sequence. You can then parse out the iBeacon fields. Here is the code the shows how this is done:
https://github.com/RadiusNetworks/android-ibeacon-service/blob/master/src/com/radiusnetworks/ibeacon/IBeacon.java#L177-L231
The only catch here is to detect beacon even the app is not running. Unlike iOS7, it is not natively support. In iOS7, when you on your BT, it will automatically notify you when you enter the region of registered iBeacon.
I had implemented iBeacon in Android 4.3 API using IntentService plus AlarmManager. To do a scan every 30 sec( to save your battery power, it shall be longer). It works well for user. Only when the matching uuid/major/minor is found, then it will trigger notifications. Otherwise, it will sleep and wake up for scanning again.
i think this is the solution for your question.
I didn't quite get what you mean, could you provide links to the documentation which said that you should not poll the data?
But it seems to me that the iBeacon is working as a server, which is kind of funny to me. Isn't it meant to find other devices, not the phone itself?
https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.position_quality.xml
This is the characteristics it uses though. To me it sounds like that the devices you are looking for are the "beacons" and the phone itself is just a listener. So you would not poll the EHPE and EVPE data but you should actually listen to it's changes or "broadcasts".
I'm kind of new to this myself also and couldn't find any really specific documentation.
Though, be advised, in the link I provided there is download link in the top corner which will provide you the full documentation in PDF format. There you will probably find more answers.

Categories

Resources