Android 物联网和蓝牙

Android Things and Bluetooth

据我了解开发板,每个 SoC 都能够使用蓝牙。

我还没有测试过,但是我可以使用 Android 有蓝牙连接的东西吗?我的问题是,如何在没有输入设备的情况下启用蓝牙?如果我想在 phone 上启用蓝牙(使用代码),我必须确认它,但这在 Android Things 上是不可能的。

Android Things 将使用最新版本的蓝牙,称为低功耗蓝牙,两者之间唯一的相似之处在于名称中有蓝牙!

Can I use Android Things with a Bluetooth connection?

是的,蓝牙低功耗连接

https://www.link-labs.com/bluetooth-vs-bluetooth-low-energy/

In summary, Bluetooth and Bluetooth Low Energy (BLE) are used for very different purposes. Bluetooth can handle a lot of data, but consumes battery life quickly and costs a lot more. BLE is used for applications that do not need to exchange large amounts of data, and can therefore run on battery power for years at a cheaper cost. It all depends on what you’re trying to accomplish.

你想知道的关于 BLE 的一切都写在这里:

https://developer.android.com/guide/topics/connectivity/bluetooth-le.html

how can I enable Bluetooth without an input device?

您不像以前那样将 BLE 设备与旧蓝牙配对(但您可以使用绑定)。看看这个:

Android Bluetooth Low Energy Pairing

但正如@shalafi 所述Android Things 目前不支持蓝牙

更新: 自 Android Things 开发者预览版 3 发布以来,蓝牙和 BLE 现已可用。

旧答案

没有。当前版本的 AndroidThings(开发者预览版 1)不能使用蓝牙。

release notes 已知问题 部分中提到蓝牙当前已禁用(USB 也是如此)。

它应该在某个时候包含在内,但目前如果您尝试获取 BluetoothAdapter 它会 return null.