Android 4.3 as a Bluetooth LE Peripheral

2019-01-19 08:21发布

问题:

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.

回答1:

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.



回答2:

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



回答3:

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).



回答4:

android phones with Broadcom Bluetooth solution already supports it



回答5:

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.