Android Things and Bluetooth

3k views Asked by At

As far as I read about the dev boards, every SoC is capable to use Bluetooth.

I didn't tested it yet, but can I use Android Things with a Bluetooth connection? My question is, how can I enable Bluetooth without an input device? If I want to enable Bluetooth on my phone (with code), I had to confirm it, but this can't be possible on Android Things.

2

There are 2 answers

0
shalafi On BEST ANSWER

Update: Since the release of Android Things developer preview 3, Bluetooth and BLE are now available.

Old Answer

No. You can not use Bluetooth with the current version of AndroidThings (developer preview 1).

It is said in the known issues part of the release notes that Bluetooth is currently disabled (and so is USB).

It is supposed to be included at some point, but at the moment if you try to get a BluetoothAdapter it does return null.

1
Blundell On

Android Things will use the latest version of Bluetooth called Bluetooth Low Energy and the only similarity between the two is that they have Bluetooth in the name!

Can I use Android Things with a Bluetooth connection?

Yes, well a Bluetooth Low Energy 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.

Everything you need to know about BLE is written here:

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

how can I enable Bluetooth without an input device?

You do not pair BLE devices like you used to with the older Bluetooth (but you can use Bonding). Check this out:

Android Bluetooth Low Energy Pairing https://stackoverflow.com/a/20093695/413127

But as stated by @shalafi Android Things doesn't currently support Bluetooth