How to scan ibeacons using cordova-plugin-ibeacon? - android

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.

Related

Flutter_Beacon Library sample app doesn't detect iBeacons

I've been trying to use the sample app in the flutter_beacon library to detect beacons nearby and have bought an "Avvel" iBeacon that I have set up and can detect using the "BLE Scanner" app from the google play store. I made sure to allow location tracking within the sample app, as well as having a constant wifi connection and having my Bluetooth on. It just doesn't pick it up and by that, I mean that I have a spinning circle in the middle of the screen, and in my console in "Android Studio" I get the message
I/flutter (15631): {"region":{"identifier":"Cubeacon","proximityUUID":"cb10023f-a318-3394-4199-a8730c7c1aec"},"beacons":[]}
every half second or so.
The repo for the sample app is the master branch here: https://github.com/alann-maulana/flutter_beacon.
The phone is an original Pixel but as I said, I can detect the beacon using another beacon detection app so I doubt its a hardware issue.
Below is the image of the screen. (Taken from the android emulator in android studio for ease of screenshotting rather than the actual phone).
image
Any suggestions or solutions would be greatly appreciated. If you need anything else from me then I would be more than happy to oblige.
The problem is that the beacon region defined in the sample app has Proximity UUID cb10023f-a318-3394-4199-a8730c7c1aec, and the beacon used for testing has Proximity UUID EBEFD083-70A2-47C8-9837-E7B5634DF524. These must be the same. To get the program to work, change the region definition in the Flutter sample to match your beacon's UUID: EBEFD083-70A2-47C8-9837-E7B5634DF524.

Cannot detect iBeacon using AltBeacon/android-beacon-library

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?

Mimicking NFC with iBeacon: plausible? appropriate?

I'm creating an app in which a key piece is transferring data when two people press a button on the app on their respective devices and then press their phones together (Yes, Bump on Android does this. That isn't the point). I know I could use NFC on Android to get this done. However, I wouldn't be able to do this on iOS because iOS doesn't support NFC. Earlier today I read about and discovered iBeacon, which is apparently some Bluetooth 4.0 implementation that works with both iPhones and Android devices. I've read about retail use-cases of iBeacon, where stores could set up beacons and when users walk by or are close enough, it'll trigger an action. Is the use-case of mimicking NFC for my purposes to be able to do reach iPhone users plausible? Should I be using another solution? Is this not the purpose of iBeacon and it wouldn't work?
From my experience with iBeacon on Android, you can indeed use it to replace NFC, as there are 3 'ranges' (immediate, near and far). iBeacon is based off BLE (Bluetooth Low Energy) and very light on power consumption as the name would suggest.
If you are trying to trigger actions on devices in a certain vicinity, i'd say using iBeacon is the most plausable method.
Android doesn't natively support 'iBeacon' as Apple created it, but it is based off Blueooth 4.0, a library has been created to mimick the iOS implementation of iBeacon
Android iBeacon Library
One thing to note, is that when using iBeacons, you cannot transmit data. Only two numbers (a major, and minor) and a UUID used solely for identification purposes.
The main problem with using iBeacons for this is that iBeacons are transmit only devices designed only to alert phones to their presence. The technology cannot exchange data.
You could do something like you describe with low-level programming with Bluetooth LE technologies, but iBeacons alone cannot do the job.

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