title: Android Remote control app (on phone) for controlling Android TV
body: <p>I've skimmed through the Google TV Pairing protocol and downloaded the TV Paring protocol sample code from <a href="https://code.google.com/p/google-tv-pairing-protocol/">https://code.google.com/p/google-tv-pairing-protocol/</a></p>
  
  <p>I've also read about the Anymote protocol but realized that it only works on the obsolete Google TV. Similarly, the Google TV Remote app sample code for Android also works only with Google TV</p>
  
  <p>But I've found nothing to help me write a remote control app for Android TV. 
  Now, I know I can do the pairing with Android TV using the TV Pairing protocol (again, didn't find much docu on the protocol details but let's assume I'll figure that out from the TV pairing protocol source code). </p>
  
  <p>The question I have is: after successful pairing with Android TV, how do I figure out how to communicate with the Android TV to send key events to it from my remote app (over Wifi/Bluetooth) ? What is the protocol used here (it's not Anymote) and where can I find the proto details ? It doesn't seem to be public for some reason. </p>
  
  <p>I need to send keystrokes to Android TV using the existing method used by Android TV to receive key events (eg. the latest 'Remote Control for Android TV' app by Google is able to send key events to Android TV), else I'll have to deal with making my own Android TV service to receive key events and then deal with doing key injection on the Android TV device, and key injection is ONLY allowed with the INJECT_KEYS permission which means I'll have to make my own AOSP image and sign my Android TV service with the system keys in order to be able to do key injection. </p>
  
  <p>Any help on this is appreciated. </p>