Francois Girard Francois Girard - 8 months ago 48
Android Question

Android bluetooth scan of already paired

I'm making an Android application that scan all device in the room and connect/pair to the device automatically or not, depending on the name prefix.

I tried some examples and the scan result return only unpaired devices. So I need that the result of the scan return also already paired devices. Is it possible on Android ? (I already done this on windows)


Yes. You need to get the local bluetooth adapter

Adapter = BluetoothAdapter.getDefaultAdapter();

get paired devices into a private set Bluetooth device

devicepair = Adapter.getBondedDevices();

And then from that point it should be a simple for loop to add device pair to a list view that shows your bluetooth devices

 for(BluetoothDevice : devicepair)
//your array name or whatever inside the for loop