title: android 6+ How to connect wii balance board?
body: <p>I made an Android app that connected and readed input fine with Wii balance board, based on <a href="https://github.com/paulburton/fitscales" rel="nofollow noreferrer">Fitscales code</a>.
  My app worked like a charm with SDK 15 &amp; 16 until Android 4.4 (KitKat), when Android stopped the Wii support.
  Wii support is now re-enabled, starting with <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/android/bluetooth/BluetoothAdapter.java#BluetoothAdapter.listenUsingInsecureRfcommWithServiceRecord%28java.lang.String%2Cjava.util.UUID%29" rel="nofollow noreferrer">Android 5.1.1</a>. I have also implemented the new permission scheme for obtaining Bluetooth connectivity permissions (inlcuded ACCESS_COARSE_LOCATION)</p>
  
  <p>My problem is that I can't read Wii balance board input anymore.</p>
  
  <p>I can discover, create socket and when connecting to socket I receive the message: <code>read failed, socket might closed or timeout, read ret: -1</code></p>
  
  <p>Answer that helped me so far and not working anymore:</p>
  
  <p><a href="https://stackoverflow.com/a/18688861/3743093">Create wiimote socket</a></p>
  
  <p><a href="https://stackoverflow.com/a/14781177/3743093">How to connect</a></p>
  
  <p>Some code:</p>
  
  <pre><code>private BluetoothSocket createBluetoothSocket(
          int type, int fd, boolean auth, boolean encrypt, String address, int port){
      try {
          Constructor&lt;BluetoothSocket&gt; constructor = BluetoothSocket.class.getDeclaredConstructor(
                  int.class, int.class,boolean.class,boolean.class,String.class, int.class);
          constructor.setAccessible(true);
          BluetoothSocket clientSocket = constructor.newInstance(type,fd,auth,encrypt,address,port);
          return clientSocket;
      } catch (Exception e) {
          Log.v(TAG,"createBluetoothSocket failed: "+errorMsg(e));
          return null;
      }
  }   
  
  
  private connectWii(String MAC) {
      try {
          // MAC is the MAC address of Wiiboard
          int TYPE_L2CAP=3;
          sk = createBluetoothSocket(TYPE_L2CAP, -1, false,false, MAC, 0x13);
          // this fires read failed, socket might closed or timeout, read ret: -1
          sk.connect();
      } catch (Exception e) {
          Log.v(TAG,"Failed : "+errorMsg(e));
      }
  }
  </code></pre>
  
  <p>Thank for your help in advance.</p>