I'm trying to communicate two smartphones with Android 5.x through BLE.
First of all, I've installed the sample app from Google (https://github.com/googlesamples/android-BluetoothLeGatt) to test if the devices are correctly y scanned, but tablets and smartphones are not detected (the bluetooth is visible and enabled in both cases).
In the list only appears bracelets like Xiaomi MiBand, Fitbit... and some Macbooks, but nothing else.
I've read this report: https://code.google.com/p/android/issues/detail?id=82293
and this post (with Android 6.0 must be enable the location): Bluetooth Low Energy startScan on Android 6.0 does not find devices
I've tested with multiple scan apps from the Play Store, but all of them show the same result... I'm going crazy.
Scanning from Settings -> Bluetooth the result is correct (smartphones and tablets are detected).
Any idea about this problem? Why this devices are not appearing on the BLE scan?
Smartphones and tablets used to test:
Samsung Galaxy S5
Xiaomi Redmi Note 2
BQ Edison 2
iPhone 5
If device has BLE it does not mean that it will be visible (broadcast) any data by default. In order to achieve communication between two smart phones you need to have (install or write your own) application that uses BLE to create proper BLE service that will be exposed to other devices.
Some BLE capable devices such is iPhone for example broadcasts BAS (Battery Service) or similar, but I don't think that Android does.
So, don't expect to find any device on scan that you have described, and if you still need
to communicate two smartphones with Android 5.x through BLE
try to read Bluetooth Low Energy documentation and be ready to understand UUID, GATT, Characteristic...
Related
I'm writing an app that connects to bluetooth low energy devices and reads data from them. Specifically, I use the startLeScan() method for BLE scanning. Up to this point I've been using a Kindle Fire for debugging, but BLE scanning has been extremely unreliable. The scanner in the Kindle's wireless settings is able to instantly discover the devices, but in my app, it only discovers the devices about 1/15 times. Furthermore, the results are the same with the sample scanner provided Android, so I'm not sure if it's actually a problem with my code. I've also tested my own app on my friends Samsung Galaxy S7 and it discovered the devices immediately without any problems. Does anyone know what could be causing this issue with the Kindle Fire?
In talking with customer support at Amazon today, the Kindle Fire does not support BLE. "Fire tablets run a different hardware and software system that is not the same as Android which is why the Fire devices are unable to support Bluetooth low energy (BLE) devices."
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.
I am using Google sample code for BLE. I have 2 nexus 4 phones. When i install the app on one phone and try to scan for any other BLE enabled devices, it does not display any device. Is there any problem in the code or BLE on phone cannot detect BLE enabled mobile phones?
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#roles
You have to first understand that how BLE works. There are central and peripheral roles. Read the link above, you will find that now Android only supports central role, and central cannot be discovered by another central.
I am currently working on an Android project that requires Bluetooth Low Energy Peripheral mode. As of now, just targeting the Galaxy S4 with 4.2.2 on it Samsung BLE SDK at http://developer.samsung.com/ble
I followed their API docs and programming guide very closely, however broadcasting characteristics or services over Bluetooth Low Energy just doesn't seem to work. Has anyone else had any luck with getting this to work yet? If so, any help would be greatly appreciated!
Thanks a lot.
Because Samsung BLE SDK only supports the central role, “advertising” a service as a central server means sitting their quietly, only revealing (or “advertising”) its service characteristics to another device in peripheral mode after a connection is already established. This connection establishment requires another device to do the actual radio advertising first. Samsung’s SDK isn’t going to do it.
What we need is an Android BLE API that allows creation of a peripheral server. Lots of folks were hoping that peripheral role support would be added in 4.4, but it wasn’t. Maybe we can hope for its addition in Android 4.5 or 5.0. There is a feature request asking for this. Add your name to the list!
Source
I am having the exact same issue. I can discover BLE devices and get their rssi values, but when I try to discover services or connect, I never receive a callback. I am using a Verizon Galaxy S4 running 4.2.2. I am using the Samsung BLE SDK 2.0. Apparently some heart rate monitors are working, but I get nothing using my ez430-rf256x TI development kit. I've tried the Keyfob demo and Heart Rate Profile demo in the Bluetopia v1.3 sdk.
Phones/tablets/pc's support(usually) Bluetooth dual mode chip. According to Bluetooth specification dual mode devices can't be a peripheral, but single mode devices do.
I need to develop an Android application handling the data from a custom built Bluetooth Low Energy client device.
After researching it seems that the best option is to use the API's developed by Motorola for their Android smartphones, but it looks like the Motorola Bluetooth Low Energy API is made to connect only with Motorola bluetooth devices, from the link:
applications can use [the Motorola Bluetooth Low Energy API] to interface with Bluetooth LE (Low
Energy) profiles implemented by certain Motorola Mobility devices
Besides the above mentioned API, there is the Motorola Bluetooth Low Energy GATT Framework API, but it is unclear to me whether it is applicable for my needs.
Can anyone here tell me how these API's can be used to achieve my goal or whether there are other options that I haven't realized yet?
Android options for BLE are limited, and this answer may be different at any given point in the future.
Motorola API will only work for Motorola phones. The GATT API will allow you to push data to the GATT and transmit it via ble. HOWEVER Motorola has ONLY extended the HRM profile. Additionally the API stopped working on devices that were updated to ICS (as of 10 days ago this is still the case). They are working to update the API as well as possibly extend the profiles beyond HRM. There have been people that have simply leveraged the HRM profile to shuttle data, but there is currently a 2 octet limit.
There are additional bugs that have been reported as well, that are also supposed to be fixed in the post ICS updates. However since it took them a year to get ICS out to their headsets and all of the Motorola apps are still working, who knows when they'll update the API's.