title: How to find bluetooth mac address programmatically in Android api level 19
body: <p>I need to find bluetooth mac address in android. Below code</p>
  
  <pre><code>BluetoothAdapter.getDefaultAdapter().getAddress();
  </code></pre>
  
  <p>It works fine with api level 18 and below.</p>
  
  <p>How to find the same with api level 19.?</p>
  
  <p>"To get a BluetoothAdapter representing the local Bluetooth adapter, when running on JELLY_BEAN_MR1 and below, call the static getDefaultAdapter() method; when running on JELLY_BEAN_MR2 and higher, retrieve it through getSystemService(String) with BLUETOOTH_SERVICE" from <a href="http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html" rel="noreferrer">http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html</a></p>
  
  <p>I am getting the following error: </p>
  
  <pre><code>bluetooth binder is null
  </code></pre>
  
  <p>with both</p>
  
  <pre><code>BluetoothManager ba=(BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
  bmac=ba.getAdapter().getAddress();
  </code></pre>
  
  <p>and </p>
  
  <pre><code>bmac=BluetoothAdapter.getDefaultAdapter().getAddress(); 
  </code></pre>
  
  <p>on emulator and genymotion emulator for api level 19,kitkat</p>
  
  <p>Help!</p>