AlexaDirectiveReceiver. This class is where you accept and handle the directives Alexa sends to your app.
Declare a BroadcastReceiver and Intent Filter in Your Manifest
The VSK Agent on Fire TV will send directives in intents that your app will receive. In your app’s manifest, declare a BroadcastReceiver with an intent filter for handling Alexa directives and other capability reporting from the VSK Agent. This BroadcastReceiver will handleACTION_ALEXA_DIRECTIVE and ACTION_REPORT_CAPABILITIES in its intent filter.
In the following manifest example, the name of the BroadcastReceiver is AlexaDirectiveReceiver, which is how the BroadcastReceiver is named in the sample app. Change this name to whatever you call your BroadcastReceiver in your app.
Add a BroadcastReceiver Java Class
Add a BroadcastReceiver Java class (e.g.,AlexaDirectiveReceiver) that can handle various intents sent from the VSK Agent. You can name the receiver whatever you want as long as the class matches up with your manifest declaration (in the previous section).
The BroadcastReceiver class takes care of handling all the directives that are received by Alexa. Alexa sends directives to the VSK Agent, and the VSK Agent communicates the directives to your BroadcastReceiver.
The following is a boilerplate example of the BroadcastReceiver class:
true or false Boolean as the success parameter.
The next step, Step 8: React to Directives, goes into much more detail about the various directives that your app will receive and how to handle them.
Testing Your Dynamic Capabilities Integrations (Optional)
With dynamic integrations (regardless of whether you integrate using the VSK Agent Client Library or raw VSKApplicationAgentAPI package), you can call thesendCapabilityTestDirective method to test your app’s integration. Calling this method causes the Fire OS routing agent to report back the capabilities for calling the app as a VSK directive.
This method is not intended to test that any particular directive handling is working. Its purpose is to verify that the device communication channels are working, so that you can see that you’re correctly reporting your app’s capabilities and that your BroadcastReceiver can receive intents from routing agent — without the need to connect to a Fire TV device or make a request/utterance.
The following code shows how to make a call to the sendCapabilityTestDirective() method.
requestTestDirectiveFromVSKAgent() method will trigger the VSK routing agent to send a test directive to your app, with no need to make a request/utterance to Alexa. The payload of this intent will be a JSON list of the capabilities that the routing agent has on record for your app. For example:

