title: Android Bluetooth HID connection on paired device
body: <p>i am trying to realize the following scenario and am failing to do so since about a week.</p>
  
  <p>I have a bluetooth mouse which i'd like to connect to my android phone and use it in an app. The problem is that i don't want to use the built in HID protocol because it has some limitations i don't like (especially swallowing signals when to short and stuff like that). In optimum case i want the app to start, open an inputstream to the already paired and connected BT mouse and add my listeners to it.</p>
  
  <p>Well what i did achieve to do is, given that the device is NOT connected to the built-in android BT Manager, get a BluetoothSocket, connect to it and add my inputstream to it. Problem is: If the user decides to use the OS features to make the connection, my app fails. Also i have to etablish the connection (by clicking the BT-button on the mouse) with every app start. I currently open the connection by using java reflection to call "createRfcommSocket"and then connect if getInputStream().available() fails.</p>
  
  <p>How can i directly read the data of the BT device, without using the HID protocol? It doesn't matter if the mouse-functions still work or not.</p>
  
  <p>If such a thing is not possible, i'd like my app to remeber the pairing process with the app. Meaning: When i start the app, i want my last pairing to reetablish automatically (without pushing the connect-button). Android itself is able to do it (I turn on BT, click on the mouse left-button -> the mouse connects).</p>
  
  <p>I would really, really appreciate every hint you have for as i'm desperate.</p>