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: 
In version 1.3.\*, you cannot longer declare a global controller function.

Instead define a module, and use your controller function:

```
var SidController = function($scope){

  $scope.message = "WElcome.";

};
SidController.$inject = ['$scope'];
angular.module('app', []).controller('SidController', SidController);

```

In your html

```
<html ng-app="app">

```

See this [plunker](http://plnkr.co/edit/VbO3L5PtiCO0JrAwBjf5?p=preview).
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"

```