user2508120
user2508120

Reputation: 31

Android Bluetooth LE and Classic Bluetooth API

I am writing an App to be able to connect to Bluetooth LE devices and old classic Bluetooth devices. In Android OS 4.3, different API is used for LE and classic.

How can I auto-detect to know that the devices that I connected to are Bluetooth LE devices or classic Bluetooth devices so that I can choose the correct API to connect?

Upvotes: 1

Views: 1277

Answers (1)

Rafael Tabosa
Rafael Tabosa

Reputation: 46

You have probably to scan the devices twice, for BLE devices use: BluetoothAdapter.startLeScan, for classic Bluetooth devices use: BluetoothAdapter.startDiscovery.

Upvotes: 2

Related Questions