Question: I am trying to get the MAC address of a bluetooth device when I click on a device in the listview. I want to pass in the MAC address in 

`BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);` 

Is there a way I can extract the MAC address when I choose a device on the listview. Thanks

```
 @Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
    if (mBluetoothAdapter.isDiscovering()) {
        mBluetoothAdapter.cancelDiscovery();
    }
    if (listAdapter.getItem(i).contains("Paired")) {

        BluetoothDevice selectedDevice = devices.get(i);
        BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
        mBluetoothAdapter.cancelDiscovery();
        try {
            btSocket = device.createRfcommSocketToServiceRecord(MY_UUID);
            btSocket.connect();

        } catch (IOException e) {
            try {
                btSocket.close();
            } catch (IOException e2) {
            }
        }
    }
    }
}

```

Answer: 
Check this plunkr
You need to define your module and then register the controller

<http://plnkr.co/edit/9zAV5nSWH05FYscEWYZ5?p=preview>

```
angular.module( 'demoApp', []);

angular.module( 'demoApp' )
    .controller( 'SidController', function($scope){
  $scope.message = "WElcome.";
});

```
You should create your module.

```
angular.module('app', []).controller("SidController", function($scope) {
  $scope.message = "WElcome.";
});

```

Then in your html element, set your attribute like this:

```
ng-app="app"

```