Step 5: Report Your App's Static Capabilities (VSK Fire TV)
With the static capabilities integration, all content is searchable and playable for free, with no user authentication needed. As such, there's no need to dynamically report your capabilities based on a user login state, and you can indicate your app's capabilities directly in your app manifest. The VSK Agent will detect those capabilities as referenced in your manifest automatically.
The sample app already reports static capabilities, so you do not need to do any coding in this step. In the sample app, see the
AndroidManifest.xml and raw/static_capabilities files for details about how the static capabilities are declared.Declare Static Capabilities
The VSK Agent is an on-device routing agent on Fire TV that sends VSK directives to your application (through intents). The VSK Agent scans your app's AndroidManifest.xml for static capabilities to see your app supports. Declare your app's static capabilities as follows:
-
Open your
AndroidManifest.xmlfile and add the following resource inside theapplicationelement.<meta-data android:name="com.amazon.alexa.vsk_app_agent_api.capabilities" android:resource="@raw/static_capabilities" /> -
This previous code references a resource at
@raw/static_capabilitiesthat lists details about the capabilities your app supports. Add this file (calledstatic_capabilities— no file extension) insideapp/res/rawin your project.This
static_capabilitiesfile lists capabilities that your app always supports. This file will be scanned by VSK Agent on app install or app update. This means the user can control your app by voice without opening it for the first time.Sample App Notes
The sample app also shows other capabilities files inside therawfolder. You can disregard these other capabilities files, as they are used only for the dynamic capabilities integration. -
In the
static_capabilitiesfile, list the capabilities your app supports.The contents of
static_capabilitiesmust be a JSON object containing a singlecapabilitiesarray, with each object in the array listing a different capability. See Supported Capabilities with App-only Integration for a list of all possible capabilities you can add in the JSON file.For example, to declare support for the
RemoteVideoPlayercapabilities, including bothSearchAndPlayandSearchAndDisplayResultsdirectives that this interface sends, add the following code to yourstatic_capabilitiesfile:{ "capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.RemoteVideoPlayer", "version": "3.1", "configurations": { "operations": [ "SearchAndDisplayResults", "SearchAndPlay" ], "catalogs": [ { "type": "VIDEO_INGESTION_IDENTIFIER", "sourceId": "<INSERT PARTNER ID>" }] } } ] }To declare support for both
RemoteVideoPlayerandPlaybackController(not recommended), add the capability as another object in thecapabilitiesarray:{ "capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.PlaybackController", "version": "3", "supportedOperations" : ["Play", "Pause", "Stop"] }, { "type": "AlexaInterface", "interface": "Alexa.RemoteVideoPlayer", "version": "3.1", "configurations": { "operations": [ "SearchAndPlay", "SearchAndDisplayResults" ], "catalogs": [ { "type": "VIDEO_INGESTION_IDENTIFIER", "sourceId": "<INSERT PARTNER ID>" }] } } ] }In the previous code, the app now supports Play, Pause, and Stop directives from the
Alexa.PlaybackControllertoo.Warning: Although you can declare support forPlaybackControllerand other interfaces, such asSeekController,ChannelController, andKeypadController, these other interfaces aren't recommended. OnlyRemoteVideoPlayer(specifically,SearchAndPlayandSearchAndDisplayResultsdirectives) are recommended for Fire TV VSK integrations. (The other interfaces are recommended for other types of integrations outside Fire TV.)Note that if you indicate capabilities like this in your
static_capabilitiesfile, your app must be able to handle these directives. If your app doesn't support these directives, don't list the capabilities here. Alexa sends you only the directives that your app declares it supports. For example, if you declarePlaybackController, you'll get directives for this interface that you're expected to handle; if not, you won't.Sample App Notes
See thestatic_capabilitiesfile (inapp/res/raw) in the sample app for an example. In the sample app, bothSearchAndPlayandSearchAndDisplayResultsoperations are supported (these are part of theRemoteVideoPlayerinterface), andPlay,Pause,Stopoperations are supported (part of thePlaybackControllerinterface). The catalog specified isontv; however, the actual catalog used for this sample app is handled through a special backend mapping of thecom.example.vskfiretvpackage prefix and the IMDb catalog — it doesn't matter what value you use (e.g.,ontvor something else) for the catalog name in the sample app. -
In the
catalogsproperty, update the value for thesourceIdwith yourPartnerID.Your Partner ID is the same value you report to Fire TV launcher during the catalog integration with the Fire TV launcher (see Universal Search and Browse). It's also the
Partnerfield in your CDF file (which you submitted during catalog integration.) Your Amazon representative can provide this ID if you need it. See the RemoteVideoPlayer Capabilities section in "Supported Capabilities" for more details about thecatalogsproperty.
Next Steps
Go to the next step: Step 6: Report Your App's Dynamic Capabilities.

