Reputation: 21
This is a very simple question: how can I get my Bluetooth address in Android and save it into an string ?
Upvotes: 0
Views: 185
Reputation: 836
From here: http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html
String MAC_ADDR = BluetoothAdapter.getDefaultAdapter().getAdress();
Don't forget the following: <uses-permission android:name="android.permission.BLUETOOTH" />
Have you search for it before posting?
Upvotes: 2
Reputation: 1886
You can do the following :
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
String address = mBluetoothAdapter.getAddress();
Upvotes: 1