title: Android - Connecting Samsung Galaxy Ace VIA Bluetooth to NXT
body: <p>Ok so I've added the permission to the manifest file and paired my devices but I am getting a crash right here: Set pairedDevices = btAdapter.getBondedDevices();</p>
  
  <p>I attempt to connect via a button click:</p>
  
  <pre><code>private OnClickListener myListener = new OnClickListener() {
      public void onClick(View v) {
          switch (v.getId()) {
          case R.id.main_btnYes:
              connectToNXT(); // connect to NXT
                  myIntent = new Intent(v.getContext(), SelectSession.class);
                  startActivityForResult(myIntent, 0);
              break;
          case R.id.main_btnNo:
              myIntent = new Intent(v.getContext(), ExitScreen.class);
              startActivityForResult(myIntent, 0);
              break;
          }
      }
  };
  </code></pre>
  
  <p>Here is the connectToNXT() method:
  The crash occurs here: <strong>Set bondedDevices = btAdapter.getBondedDevices();</strong>
      private void connectToNXT() {</p>
  
  <pre><code>        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
  
          **Set&lt;BluetoothDevice&gt; bondedDevices = btAdapter.getBondedDevices();**
  
          BluetoothDevice nxtDevice = null;   
  
  }
  </code></pre>
  
  <p>Anyone know why this would cause a crash?</p>
  
  <p>Also, since I'm pretty new to android and bluetooth(2 days :D), could someone be kind enough to let me know of a good tutorial for android bluetooth?</p>
  
  <p>Thanks,</p>
  
  <p>Rich.</p>