Apps running on Google TV can declare custom buttons that users can add to the mobile version of Able Remote. These custom buttons can launch various activities that are part of an app. This is different from the standard quick-launch buttons for apps in Able Remote which only invokes the main activity for each app.
The following data is needed for each button:
- An Activity
- The ‘com.entertailion.android.tvremote.external.INVOKE’ action
- A 92×92 icon
- A label
Here is a snippet from the Android Manifest to declare a custom button activity:
<activity android:icon="@drawable/flute" android:label="Test Activity" android:name="TestActivity"> <intent-filter android:label="@string/button_1_label"> <action android:name="com.entertailion.android.tvremote.external.INVOKE" /> </intent-filter> </activity>
- There is a hard limit of 4 additional activities that can be exposed by an app; if Able Remote finds an app is exposing more than 4, it completely ignores all of them.
- The requirements of having a label and icon (with that resolution) is a hard requirement and if any of the two is missing, that activity will be ignored.
Able Remote will automatically detect these custom button declarations for apps that are installed on Google TV. The custom buttons will be presented to users in the mobile version of Able Remote as part of the ‘Menu/Edit Buttons’ Apps list. When the user presses a custom button, the associated activity is launched on Google TV.
Share Images and Videos
The Able Remote mobile app supports the standard Android sharing actions. Apps can beam photos and videos to Google TV using the Able Remote sharing intents. All you have to do is to set the appropriate mime type and then pass the binary data by calling the putExtra method.
Here is an example of how to share a photo that is stored on the mobile device:
Intent sharingIntent = new Intent(Intent.ACTION_SEND); Uri uri = Uri.parse("content://media/external/images/media/53"); sharingIntent.setType("image/jpg"); sharingIntent.putExtra(Intent.EXTRA_STREAM, uri); startActivity(Intent.createChooser(sharingIntent, "Share image using"));
If you want to share the video with Able Remote directly without prompting the user to select the app for sharing, you can invoke the Able Remote activity directly:
Intent sharingIntent = new Intent(); sharingIntent.setClassName("com.entertailion.android.remote","com.entertailion.android.remote.MainActivity"); sharingIntent.setAction("android.intent.action.SEND"); Uri uri = Uri.parse("content://media/external/video/media/16"); sharingIntent.setType("video/mp4"); sharingIntent.putExtra(Intent.EXTRA_STREAM, uri); startActivity(sharingIntent);
You have to enable this feature in ‘Menu’/'Settings’ in the mobile version of Able Remote. Able Remote will then automatically detect any actions supported. You can then use the ‘Menu’/'Edit Buttons’ option to add a button for that device action. This feature requires technical expertise, but does allow you do do your own home control or home automation solution. This feature is still experimental and might change in a future release.