title: Simulate USB/Bluetooth HID device locally in order to inject events?
body: <p>Is it possible to simulate a USB or Bluetooth device connected to Android?</p>
  
  <p>I would like to make an app which is able to simulate an HID device <em>locally</em>. What I mean by this is: the app should make Android believe that an USB/Bluetooth HID device is connected. This would allow my app to inject touch events globally, I hope. Is there anyway to simulate a (virtual) device? Note that I don't really care about the device, I just want to use the built-in support for HID input.</p>
  
  <p>I know a lot of people already asked about touch event injections but this approach seems to be a little bit different. I do <em>not</em> want to use this for testing purpose, so InstrumentationTestCase and the like won't help.</p>
  
  <p>Rooting the device might be an option, although I can also imagine to ask my endusers to install a specifically signed app manually (according to <a href="https://stackoverflow.com/a/16737083/2923406">https://stackoverflow.com/a/16737083/2923406</a> and <a href="https://stackoverflow.com/a/22902808/2923406">https://stackoverflow.com/a/22902808/2923406</a> this works, but it would be device specific).</p>
  
  <p>I am aware of:</p>
  
  <ol>
  <li><p><a href="https://stackoverflow.com/q/23651744/2923406">Simulate a mouse input on android</a> - This guy seems to do it in his own app, although his questions wasn't answered ;)</p></li>
  <li><p><a href="http://www.pocketmagic.net/2013/01/programmatically-injecting-events-on-android-part-2/#.U58SqfldVHV" rel="nofollow noreferrer">http://www.pocketmagic.net/2013/01/programmatically-injecting-events-on-android-part-2/#.U58SqfldVHV</a> - Needs Root. Did anyone succeeded in using this? Also, the solution seems very device-specific again.</p></li>
  <li><p><a href="https://stackoverflow.com/q/5320791/2923406">Bluetooth + simulating mouse</a> - That's <em>not</em> what I want. The phone itself should not be an HID device, but use the (virtually created) one itself. Same for this:
  <a href="https://stackoverflow.com/a/8174973/2923406">https://stackoverflow.com/a/8174973/2923406</a></p></li>
  </ol>
  
  <p>Note that I do <em>not</em> want to turn my phone into an HID device of any kind.</p>