Way to get Bluetooth Address in Android Phone

For getting bluetooth address first we need to enable bluetooth. The code snippet for getting bluetooth address is,


BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
String btMacAddress = btAdapter.getAddress();


The permission that we need to put in Manifest file is,


<uses-permsission android:name="android.permission.BLUETOOTH" />

Comments

Popular posts from this blog

AlarmManager and Notification in Android

Swipe Action and ViewFlipper in Android