How to get the address/name of connected Bluetooth device - Android

1 posts
Thanks Meter: 0
By yashwanth2412, Junior Member on 6th May 2020, 08:26 PM
Post Reply Email Thread
I need to get the CONNECTED device name and address.

This is what I have tried so far and with it I'm able to get the paired devices list and addresses.

public class MainActivity extends AppCompatActivity {

TextView mBlue;

protected void onCreate(Bundle savedInstanceState) {

mBlue = (TextView) findViewById(;

String s = " ";
BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();

Set <BluetoothDevice> devices = ba.getBondedDevices();

if (ba != null) {
for (BluetoothDevice device: devices)
s += device.getName() + "-" + device.getAddress() + "\n";
} else
s += "No address";

How to get the device address/name of connected Bluetooth device?

Please help me out with a clear code (both manifest and class code). I have seen other posts on SO but I can't make it out. Please help to solve this.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes