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: 
Working [Plunkr](http://plnkr.co/edit/FWti9DckbbcJFrZce9M2?p=preview) (with a different AngularJS version. @user3906922 has a better answer, where your version stays the same). 

Use this for HTML for instance:

```
<!doctype html>
<html ng-app>
 <head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script>
<script src="script.js"></script>

</head>
<body>

<div ng-controller="SidController">

<h1>Hello Plunker!</h1>
    {{ 5 / 2 }}<br>
{{message}}

</div>

</body>
</html>

```
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.";
});

```