title: create a connection to a BluetoothLE device using Samsung Galaxy S3
body: <p>A few days ago, I downloaded the Bluetooth Smart Scanner software on Google Play Store. After installed it on my Samsung Galaxy S3 phone, I could scan my Bluetooth LE device successfully.</p>
  
  <p>Even though I had tried all ways to scan my bluetooth LE device, there was nothing displayed on my computer. So I decompiled this software, there was a <code>startLeDiscovery()</code> method in the package <code>android.bluetooth</code>. But what confused me was that this method didn't exist in my <code>android.jar</code> of android sdk 15. </p>
  
  <p>At last, I replaced the <code>BlutoothAdapter.class</code> file and <code>BluetoothDevice.class</code> file of <code>android.jar</code> with them of Bluetooth Smart Scanner software, so that I could successfully call the <code>startLeDiscovery()</code> method in Eclipse. The source code as shown below.</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      IntentFilter intent = new IntentFilter();
      intent.addAction(BluetoothDevice.ACTION_FOUND);
      intent.addAction(BluetoothDevice.EXTRA_UUID);
      intent.addAction(BluetoothDevice.ACTION_GATT_PRIMARY_UUID);
  
      registerReceiver(searchDevices, intent);
      //bluetooth.discovery();      
      bluetooth.startLeDiscovery();
  
    }  
      private BroadcastReceiver searchDevices = new BroadcastReceiver() {
      public void onReceive(Context context, Intent intent) {
          String action = intent.getAction();
          BluetoothDevice device = null;
  
          if (BluetoothDevice.ACTION_FOUND.equals(action)) {
              device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);   
              String msg = device.getName()+"\n"+device.getAddress();
              Log.i("hella",msg);
              bluetooth.cancelDiscovery();
              connectDevice(device);
          }
      }       
  };`
  </code></pre>
  
  <p>It turned out that I successfully scanned my bluetooth LE device on Galaxy s3 phone as what I thought. Otherwise, I found there also has a <code>com.samsung.bluetoothle</code> package. As the same way, I added it in my <code>android.jar</code>. But I couldn't connect to my LE device using those methods in that package.</p>
  
  <p>I kindly request help from you to solve this problem that has plaguing us for a long time. In order to facilitate the development, I will contribute my <code>android.jar</code> on website. You'll see the <code>startLeDiscovery()</code> method and other methods in <code>android.bluetooth</code> directory. Of course, there also a  <code>com.samsung.bluetoothle</code> package in <code>android</code> directory.</p>
  
  <p>You can download the <code>android.jar</code> package <a href="http://download.csdn.net/detail/yuan8222/4709467" rel="nofollow noreferrer">here</a> ( <a href="http://ul.to/e0wn7fv9" rel="nofollow noreferrer">Mirror</a> ) . </p>