title: Is there an API or SDK to create a remote control application on SmartPhone for Android TV
body: <p>I have been tasked to create an application for android mobile to control an Android TV, preferably the dashboard/landingpage outside of any apps (settings included).
  It doesn't really matter if it's via bluetooth or wifi, although I have found that bluetooth is not possible as the HID profile is needed, and that profile is only available on API 28 (I need to support from API 19 up)</p>
  
  <p>There are some apps on the play store that already have this functionality. Most connect via Wifi to the Android TV, also pairing with it.</p>
  
  <p>By analysing the APK Files I found out some options, i.e. </p>
  
  <ul>
  <li><p>some use the
  <a href="https://github.com/ConnectSDK" rel="noreferrer">connectSDK</a> library </p></li>
  <li><p>others use what seems to be a native google package that I can't seem to find </p>
  
  <pre><code>import com.google.android.tv.support.remote.Discovery;
  import com.google.android.tv.support.remote.core.Client;
  import com.google.android.tv.remote.BuildInfo;
  </code></pre></li>
  </ul>
  
  <p>I found that a couple of years ago the Anymote Protocol could be used as well, but that one only works with Google TV, not Android TV.</p>
  
  <p>The problems I am facing right now is that the <a href="https://github.com/ConnectSDK" rel="noreferrer">connectSDK</a> library isn't being maintained and does not contain any code for Android TV connections.
  The native google package cannot be found anywhere, not sure if it's included in a specific Jar file, or maybe some obscured/hidden dependency?</p>
  
  <p>I could try to create a connection to a specific socket with Android TV, I know for example that the <code>ServiceType</code> is <code>"_androidtvremote._tcp."</code> and that the port number is <code>6466</code>. But I'm not sure what would be the best way to implement this.</p>
  
  <p>What I'm looking for are some pointers or ideas how I could tackle this problem. Maybe some references as well.</p>