I am involved in a Android Project that connects the sensor using Bluetooth 4.0. AFAIK android didn't support Bluetooth 4.0. I tried with my laptop bluetooth 4.0. I tried with Broadcom using this. Later i came to know my Laptop Bluetooth 4.0 is Atheros Bluetooth 4.0 and later i searched for Atheros Bluetooth 4.0 API using android mobiles and tablets. I saw Qualcomm having Bluetooth 4.0 tablet. I want to know, is Atheros giving API for Bluetooth 4.0 for Android SDK.
Finally, long way of search, i found that up to today(23/12/12), Atheros not giving Bluetooth API for developers. But they are providing other API's for Audio, Camera, Device Info and Sensor(mobile shake). So, can't try on laptop also. Dgel comment and link helped me a lot and made me, come to the conclusion.
Android Bluetooth (and other) API's are not specific to the hardware (or software stack).
They are generic and fairly high-level, and Yes they include Bluetooth 4.0.
The actually support for BT 4 depends on the device. Recent Nexus devices support BT4 (both in hardware and in software) as long as they have the Android 4.2 update.
If you root your device you can get to the 'raw' vendor API's, but I don't know what that looks like for BT4, or wheteher any of that is published. In most cases that is Broadcom based, not Atheros.
EDIT:
I just saw this:
http://code.google.com/p/broadcom-ble/
I'm not familiar with this, but I suspect that it was just a stop gap measure before BT4 was added to the official Android API in 4.1.
Related
Is that possible to implement iBeacon API for android 4.2 and lower with BLE?
update:
According to davidgyoung, theoretically it's possible to enable ibeacon in BLE enabled devices with android 4.3- only if building up a ibeacon API from bottom.
Bluetooth low energy technology was only added in Android 4.3+.
Prior Android devices also did not had Bluetooth chips capable of BLE (standard v4.0).
So no, you cannot make a device without a BLE chip work as a BLE chip (and even if you did, it would make no sense nor use).
Android phones must have both Bluetooth 4.0 hardware and a SDK to detect iBeacons. Generally this means Android 4.3+ and a phone made in late 2012 or later.
Samsung phones include a proprietary Bluetooth 4.0 SDK for their devices with Bluetooth 4.0 chips and Android versions 4.1 and 4.2. Devices like the Galaxy S3 shipped with this.
There is no off-the-shelf iBeacon detection library using this SDK, so if you want to detect iBeacons on these devices, you would have to roll your own.
Also, keep in mind that many if not most of these devices are already getting upgrades to Android 4.3, so this is a shrinking pool of devices for which this is possible and necessary. For non-Samsung devices and Samsung devices manufactured before late 2012, it is not possible at all due to lack of a Bluetooth 4.0 library or Bluetooth 4.0 hardware.
Till Android 4.3, an Android device with Bluetooth Low Energy support could only act as a central device. As is given in the Android 4.3 Bluetooth LE docs:
Android 4.3 (API Level 18) introduces built-in platform support for Bluetooth Low Energy in the central role and provides APIs that apps can use to discover devices, query for services, and read/write characteristics.
With the introduction of Android 4.4 KitKat, can it also behave as a peripheral device now? I couldn't find any documentation of that. If not, then do we have to wait for Android 4.5 for getting the BTLE peripheral mode on Android device? Or is there any alternative way in which an Android device can be made to act as a peripheral device?
Not in this version but there is evidence that it is coming soon.
If you look in BluetoothGatt.java in the android-19 sources there are new methods listen and setAdvData that weren't there in android-18.
However these are not documented as I don't think native support is complete yet. The last check in on AOSP for peripheral mode was titled "LE: Add peripheral role support (2/4)". Also, setAdvData and listen have this code:
if (mContext == null || !mContext.getResources().getBoolean(com.android.internal.R.bool.config_bluetooth_le_peripheral_mode_supported))
{
throw new UnsupportedOperationException("BluetoothGatt#listen is blocked");
}
Looking in android/platform_frameworks_base/blob/master/core/res/res/values/config.xml from the Android sources you can see this is currently disabled:
<!-- Boolean indicating if current platform supports BLE peripheral mode -->
<bool name="config_bluetooth_le_peripheral_mode_supported">false</bool>
Thanks everyone for the answers. Just to update, as of June 2014, it is offered in the Android L Developer preview. Hope to see it in the Android L official release. From their blog New in Android: L Developer Preview and Google Play Services 5.0:
The L Developer Preview, lets you explore many of the new features and capabilities of the next version of Android, and offers everything you need to get started developing and testing on the new platform. Here are a few of the highlights for developers:
BLE Peripheral Mode — Android devices can now function in Bluetooth Low Energy (BLE) peripheral mode. Apps can use this capability to broadcast their presence to nearby devices — for example, you can now build apps that let a device to function as a pedometer or health monitor and transmit data to another BLE device.
Update:
The bad news is that BLE Peripheral mode will only work on the newer Android devices (as per the date), viz Nexus 6 and Nexus 9. It won't work on Nexus 4/ Nexus 5/nexus 7/ nexus 10 even if you update it to Android 5.0. You can read the comment by one of the Android Project manager on BLE advertise mode not working ticket. He says:
We introduced BLE peripheral mode in Android 5.0 Lollipop. Nexus 6 and Nexus 9 are the first two production Nexus devices that support BLE peripheral mode. Due to hardware chipset dependency, older Nexus devices (4/5/7) will not have access to the feature on Lollipop.
http://developer.android.com/sdk/api_diff/19/changes.html
By looking at the full api difference, the answer in short : NO
==============
To add peripheral role support now you have to get your hands dirty to customize the Bluedroid stack in the OS level, or try your luck on XDA developers to see if anyone has done this before. I am not sure the current Android phone support peripheral role at hardware level,though .
Quick question. I can't seem to find this in the Android docs, so I don't think it is possible, but is it possible to have an Android 4.3 device (in my case, a Nexus 4) behave as a Bluetooth peripheral? I know iOS supports both peripheral and central, but it seems like Android only supports central.
I'd like to connect an Android device to a Mac using Bluetooth LE, but since OS X doesn't support peripheral mode and it looks like Android doesn't either, I might have to go with Bluetooth 2 or another communication method.
Unfortunately there is no way for Android devices to act as a peripheral. He can creates GATT servers, services and charachteristics but there is no way to make the advertising.
Doc: http://developer.android.com/guide/topics/connectivity/bluetooth-le.html
The phone supports the central role;
I'm waiting for this feature too, but it seems we have to wait for next Android releases.
Yeah, Android 4.3 does not support peripheral mode. I started a feature request on the Android Open Source Project website. If you also want to see this feature, add a comment or star the post. I think they will get around to it eventually, but it is good to let them know that this is a feature that developers are looking for.
https://code.google.com/p/android/issues/detail?can=2&q=59693&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&id=59693
issue: 59693
In API level 4, 4.1,4.2,4.3 its not possible.
Android lollipop API version 5.0.X sdk supports peripheral mode in BLE however this feature is chipset dependent (Phones).
android phones with Broadcom Bluetooth solution already supports it
If you have a Nexus 5 you can install Android L there and try it, I just did it few months ago, Android L has support to act as a peripheral.
Im doing an android app to pair a non-android device with bluetooth 4.0 LE, but my 4.0Bluetooth-android-phone doesnt discover the device anyway. I discover other devices like phones, or tablets.
The question is: Do i have to add some extra code if i want to work with bluetooth 4.0 devices?
Thanks.
Bluetooth 4.0 (or BLE) is not supported in Android at the moment. It will be supported in Android 4.3 (API level 18). Among other places, you can read more about it here and here. Several Android devices has already been certified with Bluetooth 4.0 support, but it won't work before the update is released.
That said, according to this post some devices does support it, but they need custom BLE libraries that the companies have developed.
Bluetooth 4.0 is same as Bluetooth 4.0 LE? , i.e. iPhone4s supports bluetooth 4.0,
does that mean iPhone4s supports bluetooth 4.0 LE ?
I know that bluetooth 3.0 != bluetooth 3.0 HS
My android phone project, msm7225A platform, bluetooth chip is WCN2243.
which version can be defined?
In short, from hardware and software aspects, how to confirm Bluetooth version
(when using bluez stack, and take android phone for an example)
it is really a problem that confusing me for a long time.
appreciate anyone give some help.
Not sure if I got your questions correctly, but maybe this helps:
Bluetooth 4.0 specifies two modes of operation: "classic" Bluetooth and "Bluetooth Low Energy (LE)". iPhone 4S's Bluetooth is dual mode, i.e. it supports both classic & LE. IOS, though, only supports programming the latter (LE) directly via the public CentralManager API. There is no way to directly access the "classic" Bluetooth stack in IOS.
The standard Android SDKs only support classic Bluetooth. If you want to use LE, this answer suggests to use a manufacturer API.
BlueZ supports LE's GATT server at least. I haven't worked with that though, so I can't tell how complete LE support is. If you're about to use BlueZ directly on Android phones, mind that this will only work if the user has root access.
To answer more generally, LE could/should also have been published without calling it "Bluetooth" at all. So to determine if the hardware/software supports classic and/or LE, you'll have to look at the specs for each platform you're targeting.