Can a HTC advertise itself as a BLE Beacon? - android

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

Related

AltBeacon library with Bluetooth 5 (beacon detectable range)

I'm using the Altbeacon library currently.
I used ADVERTISE_MODE_LOW_LATENCY and ADVERTISE_TX_POWER_HIGH for the transmitter app, and my device supports Bluetooth 5. So I guessed the beacon should be detectable in about 30~50m range. However, the beacon was detected in about 5~7 meters instead of the expected range.
All I want to ask is, As far as I know, Bluetooth 5.x is a standard that extends the communication range, so why are beacons still only detected within 6-7 meters? There is an any option for extend detectable range in BeaconManager?
A few points:
Bluetooth 5 is largely a marketing term. Just because a device says it supports Bluetooth 5 doesn't mean it supports all "optional" features. I learned this the hard way when trying to program a Raspberry Pi 4 with BLE 5. Long range advertising is an optional feature.
When it comes to long range advertising, the specific feature you are talking about is called Coded PHY. This is a physical layer that uses hamming codes for forward error correction. This is what enables advertising to be detected at long range despite the same radio power.
The Android Beacon Library's transmitter and scanner do not use long-range BLE 5 features even if the device hardware and bluetooth stack supports it. The reason we have not put support into the library for this is because there remains very little opportunity to use this feature -- iPhones do not support it, very few hardware beacons support it, and even many newer Android devices do not support it.
Android 8.0+ has APIs to enable this. You want to use PHY_LE_CODED for both advertising and scanning. To play with it, you'll need to phones that support PHY_LE_CODED. Read more here: https://source.android.com/devices/bluetooth/ble_advertising

How to change Eddystone Beacon setting by not using any beacon manufacturer SDK

How can we change the different setting of an beacon with Eddystone Protocol without using any third party SDK, like the SDK's provided by Estimote or AltBeacons. How, for instance can we change the transmitting power/transmitting frequency or the Instance ID of an beacon from our mobile devices (maybe with the help of an app)? Can we change them by using the Bluetooth Manager or BluetoothLeScanner present in Android ? Can it be done or we have to rely on the Beacon manufacturer's SDK to change the values?
No, you cannot change the settings on an Eddystone beacon using any built-in Android apps or OS functions. You need a third party app to do this. For now, this means one of the beacon manufacturer configuration apps you mention.
There are plans to change this. Google has a draft specification for a standard Eddystone configuration service. Beacon manufacturers adopting this spec have hardware that can be configured by any app that supports the standard. So while you will still need an app, you would not need one from the beacon manufacturer. (You could even build your own.)
Still, there are no announced plans by Google to put a default configuration app into Android using this standard. So the need to install some app will probably not change. With the standard, you will just have more flexibility in the app you install.
Full disclosure: I am the lead developer on the Android Beacon Library project, an SDK that is part of the AltBeacon project.

Android Wear Device as iBeacon

Is it possible to use an Android Wear device as a Bluetooth Low Energy beacon, separately from its connection to the phone?
I'm working with iBeacons that connect to both iOS and Android devices, and the iBeacon (Bluetooth Low Energy) capabilities of various mobile devices vary widely.
Most of Apple's devices (iPhones, recent iPads, and laptop/desktop devices) can transmit as an iBeacon. Only certain recent Android devices can do so, e.g. the Nexus 6 and Nexus 9.
I just purchased a Moto 360 to play around with and it does use BLE to transmit to the paired device, but I'm curious if I can write an app that will cause it to transmit arbitrary packets and an arbitrary UUID. Has anyone done that? It seems as though it should be possible. I've gone through the Android Wear developer's site but have not found any discussion of this topic.
Thanks for any ideas, links to web sites, etc.
UPDATE:
I just test my answer below and it seems like the Android.Bluetooth.LE namespace is not available for Android Wear. I'm afraid I have to say that (currently) it is not possible for an Android Wear device to broadcast as a beacon using native java Android.
EXPLANATION:
You can perform that test yourself. You mentioned you have a Moto 360. Just deploy a test app to it that gets the Bluetooth system service as BluetoothManager and test wether the adapters BluetoothLeAdvertiser property is not null.
((BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE))
.getAdapter().getBluetoothLeAdvertiser() == null
((BluetoothManager) this.getSystemService(Context.BLUETOOTH_SERVICE))
.getAdapter().isMultipleAdvertisementSupported() == null
You can use Android's native beacon broadcasting libraries or use a 3rd party library like AltBeacon to broadcast arbitrary beacon data.

iBeacon, AltBeacon, *Beacon: What interoperability is legal, and permitted on iOS and Android?

I want to support only one Beacon standard if possible, and have the device itself act is the "host/beacon", and other devices the "listener".
I'm supporting Android, iOS, and possibly Windows phone using Xamarin.
Is any interoperability supported between iOS and android?
The AltBeacon standard is precisely designed to allow the interoperability you suggest. It supports using the same 16/2/2 byte identifier scheme. Radius Networks (my company) sells RadBeacon USB units that have a dual advertisement that interleaves an AltBeacon transmission with an iBeacon transmission. This allows you to set up the beacon once with a single identifier scheme and use the AltBeacon advertisement for detection on Android devices and the iBeacon advertisement for detection on iOS devices. The open source Android Beacon Library 2.0 allows Android to get full beacon functionality similar to CoreLocation on iOS.
This is the most conservative approach for interoperability, because it does not rely on using Apple's iBeacon technology on Android devices. That said, Android devices are technically capable of detecting and decoding iBeacon signals. Configuring the Android Beacon Library to do this brings up issues of intellectual property that I am not qualified to answer.
For Windows devices, the operating system does not allow for detecting Bluetooth LE beacons as of Windows 8.1 (either mobile or desktop versions). This is expected to change in Windows 10, but that will not come until late 2015.
Check this library to give you some guidance.
https://github.com/AltBeacon/android-beacon-library
It allows Android devices to use beacons much like iOS devices do. An app can request to get notifications when one or more beacons appear or disappear. An app can also request to get a ranging update from one or more beacons at a frequency of approximately 1Hz.
You can also find more information on this blog:
http://vincenth.net/blog/archive/2014/04/24/building-cross-platform-ibeacon-apps-for-ios-android-and-windows-with-c-and-xamarin.aspx

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.

Categories

Resources