Introduction
Amino provides each H200 with an Oak remote control. This remote has several keys that can be customized.
Key handling integration
As Global keys will most likely not cover all the needed actions, we provide two different ways of customizing their behavior:
- Defining Function Keys in the Amino Device Management System (INI parameters);
- Receiving the global key and handling them directly in APP.
Global key - Define the function
Using a default configuration, your H200 STB will raise the keys as global, which means they will be processed either by AOSP itself or by any foreground APP that can process it.
Here's a list of all the keys available as Global keys:
Remote Key | Android Key Code | Global key configuration |
Red | KEYCODE_PROG_RED | globalkey.red |
Green | KEYCODE_PROG_GREEN | globalkey.green |
Blue | KEYCODE_PROG_BLUE | globalkey.blue |
Yellow | KEYCODE_PROG_YELLOW | globalkey.yellow |
Receiving the Global Key
In order to receive the global keys, the APP has to have the following:
- A receiver that implements an intent filter for the intent
android.intent.action.GLOBAL_BUTTON
; - The package ID should be defined in this INI parameter: tvapp.package_id.
Here's an example of the global key receiver intent filter, defined in APP AndroidManifest.xml:
<receiver
android:name="com.android.tv.livetv.receiver.GlobalKeyReceiver"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.GLOBAL_BUTTON" />
</intent-filter>
</receiver>
Customized key handling
Amino provides the capability of customizing the behavior of a big part of the OAK remote keys. There are three different ways these keys can work:
- Trigger Deeplink;
- Trigger an APP, based on package ID;
- Trigger a specific Activity within an APP;
In order to switch from the default Global key to one of the three options above, the following INI parameters need to be added:
Remote key | INI parameter |
RED | key.link.red |
GREEN | key.link.green |
YELLOW | key.link.yellow |
BLUE | key.link.blue |
These should then point to one of the three preferred actions, as shown:
Use case | INI format | Example |
Trigger Deeplink | URI |
https://www.youtube.com/watch?v=<youtubeId> or |
Trigger APP, based on package ID | pkg://<app_package_id> | pkg://com.netflix.ninja |
Trigger specific Activity within an APP | pkg://<app_package_id>?cls=<activity_class_name> | pkg://com.aminocom.tv?cls=com.android.tv.MainActivity |
More documentation on Deep-links can be found on the Android documentation: https://developer.android.com/training/app-links
Comments
0 comments
Please sign in to leave a comment.