I am trying to use the AltBeacon/android-beacon-library. I started with the reference app. Followed all the instruction to setup the app, but it still cannot find any beacon around. I also tried the Locate app, it cannot find beacons neither. I don't think there is anything wrong with the RadBeacons, since I can configure them with the app on iPhone. The Android phone I tried are Moto X(Android 4.4.4) and Samsung S3(Android 4.4.2), installed apps on both phones, neither of them works. Looked into the log of the library, as follows:
09-10 15:46:02.571: D/BtGatt.btif(1990): btif_gattc_upstreams_evt: Event 4096
09-10 15:46:02.571: D/BtGatt.GattService(1990): onScanResult() - address=3D:AC:95:C9:1C:D5, rssi=-64
09-10 15:46:02.571: D/BeaconService(11355): got record
09-10 15:46:02.577: D/WifiStateMachine(924): handleMessage: X
09-10 15:46:02.577: D/BeaconParser(11355): This is not a matching Beacon advertisement. (Was expecting be ac. The bytes I see are: 0201061aff4c000215078701d2fa844b429c161417dabc159d00010001c20000000000000000000000000000000000000000000000000000000000000000
Also tried to install other apps from Google Play, such as iBeacon Finder, they do find the beacon.
Are there any additional configuration needed for the app or the beacon?
Can anyone help me about this? Very appreciated!
The issue is that you are using a proprietary beacon type, which by default the library will not recognize. Understand that in order to keep the library free of intellectual property, by default it will only detect beacons meeting the new AltBeacon specification. We cannot pre-configure it to detect proprietary beacons.
You may easily configure the library to work with proprietary beacons, but you must add a line of configuration code yourself. Read the documentation in the BeaconParser class for details.
Related
I have used Demo to detect ibeacons near android phone.
But in didRangeBeaconsInRegion() callback never get 2 iBeacons detected. Even one is deactivated and other is activited it gives uuid of previous one.
Let me brief it with an example. One ibeacon is on with uuid(a unique no given to ble chip) 123. Lib is detecting it perfectly fine. Now deactivate 123 and keep on ibecon with uuid 890. But lib is still detecting 123 not 890.
I want to detect all ibeacons near my phone.
I have used other lib named AltBeacon. It solved my problem. Now multiple ibeacons get detected .They have given solution for ranging Ibeacon.
If anyone using eclipse than can get lib from here as altbeacon github repository is for gradle build system.
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?
Ive been doing some work around BLE and iBeacons. At present I'm aware that you can turn your iPhone into an iBeacon but I have not come across any details of whether this is possible with an Android phone - specifically a HTC One as that the one I've got ;)
Any advice, details or web links on this matter would be appreciated,
Thanks,
Steve
Android devices have a public APIs to transmit BLE advertisements only starting with Android 5.0. You would need to install this operating system on your HTC One to do this in a regular app. I have made an app that transmits with the intellectual property-free AltBeacon standard, and put it in the Play Store here.. Source code is available here. Again, you need Android L for this to work.
Alternatively, Android 4.4.3 also has hidden APIs that allow transmitting BLE advertisements. Building a transmitter app against 4.4.3 has three challenges:
You must manually compile a special version of the Android SDK from source to unlock the hidden APIs so you can build your app.
The permissions needed to transmit in 4.4.3 require system privileges,
So you have to root your phone to install it in as special location. This makes it impractical to distribute such an app in the Play Store.
A bug in 4.4.3 limits the length of advertisements to one byte less than needed to transmit a 20 byte beacon identifier and a one byte reference tx power value. This means you have to leave off that latter field making it impossible to "range" or estimate distance to the transmitter from other devices.
As long as your phone is L or 5.0 (I tried this on Nexus Player)
To build ontop of what David wrote.
Download AltBeacon make sure you check out branch android-l-apis
Build your aar with ./gradlew release and include in your project.
Beacon beacon = new Beacon.Builder()
.setId1("00000000-7777-5555-3333-000000000000")
.setId2("1")
.setId3("2")
.setManufacturer(0x004c)
.setTxPower(-59)
.setDataFields(Arrays.asList(new Long[]{0l}))
.build();
mBeaconTransmitter = new BeaconTransmitter(this, new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
mBeaconTransmitter.startAdvertising(beacon);
Not sure if you would upset Apple by using 0x004c ... that is their company manufacture code.
I would investigate it more if you intend production. But for engineering testing it should be ok to test around.
I'm able to detect this beacon as iBeacon in both Gimbal app on iOS and iBeacon Locate on Android.
This is possible on Android 5 Lollipop if your device supports it:
https://code.google.com/p/android-developer-preview/issues/detail?id=1570#c52
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.
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.