title: How do I access deviceName and deviceHardwareAddress from within this object?
body: <p>I have the following lines of code. I'm trying to access the Strings deviceName and deviceHarwareAddress. Do I need to construct a class that extends BroadcastReceiver and create a method within that which will return the code for me? </p>
  
  <pre><code>    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
      public void onReceive(Context context, Intent intent) {
  
          String action = intent.getAction();
          if (BluetoothDevice.ACTION_FOUND.equals(action)) {
              // Discovery has found a device. Get the BluetoothDevice
              // object and its info from the Intent.
              BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
              String deviceName = device.getName();
              String deviceHardwareAddress = device.getAddress(); // MAC address
  
  
          }
      }
  };
  </code></pre>