0

In my mobile app i have to get the connected BT address and start SPP connection. Is there any way to get the connected BT device address?

Sainath
  • 31
  • 1
  • 6

1 Answers1

0

Following may be help you

public void getDeviceList(){
        BluetoothAdapter mBlurAdapter= BluetoothAdapter.getDefaultAdapter();
        Set<BluetoothDevice> pairedDevices = mBlurAdapter.getBondedDevices();
        if (pairedDevices.isEmpty()) {
            Log.e("DeviceActivity ",
                    "Device not founds");
            return ;
        }

        for (BluetoothDevice devices : pairedDevices) {
            Log.d("DeviceActivity", "Device : address : " + devices.getAddress() + " name :"
                    + devices.getName());
        }
    }

Also don't miss to define permission

Dhaval Solanki
  • 4,589
  • 1
  • 23
  • 39
  • the above code will give the paired device list. I want the currently connected bluetooth device address. – Sainath Apr 12 '16 at 05:50
  • http://stackoverflow.com/questions/12509135/how-to-get-bluetooth-connected-devices-using-bluetoothheadset-api this may be help you – Dhaval Solanki Apr 12 '16 at 05:58