I'm trying to build a messenger that requires no bluetooth pairing. The message will be broadcast by the user who adds it and can be received by the listeners in the neighborhood.
I have read in several places that Bluetooth 4.0 has support for this. However most examples involve reading from a ibeacon or a similar device.
Can I use Bluetooth 4.0 to build both a broadcaster and a receiver android app?
I thought of leaving this here because it might be helpful for someone else.
Bluetooth 4.0 broadcast mode requires special hardware and it's only present in a few mobile devices. (Bluetooth peripheral mode) Therefore, instead of using bluetooth low energy, I used SDP (Service Discovery Protocol). The messages are limited to 13 characters.
However due to security restrictions, the app doesn't work for platforms above Jellybean.
Here's my development work. https://github.com/malithj/Seeder
Related
if i turn on bluetooth in iOS it will be discovered in beacon scanner, is it the same with Android?
Or we should turn the android to be a beacon explicitly using any libraries like alt beacon?
What am trying to achieve is to get RSSI from android by ONLY enabling Bluetooth.
No. Turning on bluetooth does not make mobile devices -- neither Android nor iOS -- advertise as beacons. If you want to make either platform advertise as a beacon, you must install a custom app that is programmed to start the advertising. The Android Beacon Library has tools to do this on Android. On iOS you can use built-in CoreLocation and CoreBluetooth.
On both iOS and Android, if you turn on Bluetooth from the settings screen and leave the settings screen up, it will emit both BLE and Bluetooth Classic packets to make it discoverable by external bluetooth scanning apps. But these advertisements will absolutely not be BLE Beacon advertisements in the strict sense. It is still possible to detect these non-beacon packets with some scanning apps.
Just enabling bluetooth on either platform might make it detectable based on what the other apps are doing. There may be pre-existing apps on the phones that emit BLE beacon advertisements, BLE GATT service advertisements, or similar. However, you cannot predict whether any individual device will do this because you can't predict what apps are installed. Nor can you know what advertisements random apps will emit in a way that is predictable. If you want to be able to rely on detecting another device with BLE in a predictable way you must get an app installed on that device.
I'm developing an app to communicate with a BLE device (Sensor puck from Silicon labs) and get whatever it is broadcasting.
I have NO experience in developing any sort of Bluetooth application using Android.
Do I need to manually pair it to the BLE device? I downloaded Sensor puck app from Play store, it automatically started to read from the device. I don't understand how since I didn't pair it.
Do I need specific API to communicate with the device? Is it like, I connect to the device and unpack the data which the device is broadcasting?
Any other information related to BLE application development would help.
Thank you.
PS: I can't use the app from the play store as I need the data from the device for some other processing.
I have a little experience with developing BLE apps.
Do I need to manually pair it to the BLE device?
I haven't encountered use case where I needed to pair mobile device with BLE device. Basically, you can communicate with BLE devices without pairing with them. BLE devices constantly emit signals and you can read these signals. Usually, from the emitted signals, you can read name of the device (or producer name), MAC address, RSSI signal from which you can compute distance from your mobile device to BLE device. Some BLE devices emit other information like temperature read from their sensors, etc. You can read information from more than one BLE device during the single scan.
Do I need specific API to communicate with the device?
Google provides API, which you can use to communicate with BLE devices. You can read more about it at: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html. You can also use some third-party libraries allowing to communicate with BLE devices. Most of them are dedicated to so called Beacons, which are simple, tiny BLE devices.
Exemplary APIs for BLE Beacons:
Estimote
Kontakt.io
AltBeacon
ReactiveBeacons - this is open-source project, which I'm currently developing, so if you have any questions regarding it, you can ask me directly
Other projects:
Android Bluetooth Demo - this is very good and simple project, which can help you to understand how to use BLE API provided in Android SDK
Other information:
To communicate with BLE devices, of course, you need to have Bluetooth enabled on your device, but regardless of this permission, you also need to have Location enabled on your device and added location permission to your app. I guess it's done due to the fact, that you can use BLE devices for creating micro-location services.
I gathered some references concerning BLE for myself. You can check them here: https://github.com/pwittchen/ReactiveBeacons#references and maybe they will be useful for you as well.
Regards,
Piotr
it might be too late, but it also might be helpful for other users. So Sensor Puck works like a simple beacon and it doesn't require any pairing. You just have to scan all bluetooth devices nerby and verify received ScanRecord object. You don't have to use any specific libs or API, Anroid sdk contain all necessary api for such case (please see BluetoothAdapter startScan, startLeScan, etc). Also you can find an example how to parse raw data in my demo project https://github.com/alexeyosminin/sensor_puck_demo
I'm trying to use NFC in order to pair two Android BLE devices. I followed latest specifications released from NFC Forum & BT SIG, called Bluetooth Secure Simple Pairing Using
NFC and I'm interested in static handover. This means I'd to write an NDEF message on an NFC tag (formatted according to specifications above) with one device, then the other one reads this tag and keep information to start BLE pairing. I'm using Android 4.4.2. and this approach works fine with Bluetooth, with no need to have specific app to manage handover, Android does the work!
But with BLE this approach doesn't work. I think the problem is related to MIME-type that I'd to write in NDEF message. For Bluetooth is application/vnd.bluetooth.ep.oob while for BLE is application/vnd.bluetooth.le.oob. When I tap device/tag, Android detects that there's a new tag with BLE MIME-type but doesn't perform any action, just shows me the screen "New tag collected", like it was unknown MIME-type. I noticed that NFC Forum specifications was released on 2014-01-09 and in Compatibility document for Android 4.4 there aren't references about BLE handover, just Bluetooth.
Does someone know if BLE pairing by NFC is supported and works on Android 4.4? And on Android 5?
I managed to test NFC/BLE handover on a Nexus 6 running Android 5 and the MIME-type application/vnd.bluetooth.le.oob has been recognised! Therefore the limit is in the Android version ...
If you want to read characteristic, you need to use read method of that property. Sample given with the SDK 4.3 works good. Also connectivity problem exists in all other devices except Samsung.
I recently attended an iOS meetup where BLE and iBeacon were discussed. Apparently on iOS your app can receive notifications of discovery of BLE services in a passive manner. That is, the OS notifies you when a new service (device) is in range.
Is there any analog to this behavior on Android? I am familiar with both the classic scanning behavior on Android as well as the new startLeScan() on Android. The problem is that both of these behaviors are considered "battery intensive" by Google and Google says to only scan when absolutely necessary.
I would like to be in a perpetual BLE scan mode for peripherals and other centrals the way that iOS devices can be. Is this functionality currently available? If not, has this functionality been announced for any upcoming versions of Android?
Is it possible in Android to transmit broadcast mode in BLE ?
And to add my own data on the transmission.
I know that BLE has a mode of transmiting in broadcast (not to a certain UUID).
This way it has very short connection time, which is what I need.
I failed to find how to do it in Android.
Any relevant link to the API ?
Look like the answer for android 4.3 and 4.4 is no.
Android 4.3 and 4.4 does not support BLE peripheral/broadcaster role
see
https://code.google.com/p/android/issues/detail?id=59693
and
https://code.google.com/p/android/issues/detail?id=58582
allow see this stackoverflow thread about the same issue
Android 4.3 as a Bluetooth LE Peripheral
The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent.