If you are new to APL, this blog article provides information on how to get started with APL to build multimodal Alexa skills. Once you know how to build an APL document, you can quickly update your existing multimodal skills in Java using APL by following the steps below.

First, make sure to select the APL interface for your skill. Go to your skill in the Alexa Developer Console and click on Interfaces. You will see Alexa Presentation Language as one of the interfaces. Toggle the button next to it and save interfaces.

Alternatively, if you are using SMAPI, you can add the APL interface to your skills.json file.

"interfaces": [
{
"type": "ALEXA_PRESENTATION_APL"
}
]

For a skill implementing a body template, we build the response with .addRenderTemplateDirective(template) and we pass in the body template object as shown in the example below:

However, for adding APL to our skill, we can remove the card [.withSimpleCard(title, speechText)] and render template [.addRenderTemplateDirective(template)] from the response. Instead, we will add the APL directive as shown below:

Note: In the code snippet above, we check if the device is a headless device or a screen device. In case of headless device (such as echo dot) we do not include the APL response. You can include a card in the response for the headless device.

You can find additional instructions on building the APL document here. This blog article explains in detail how to migrate display templates to APL. Once you have an APL document, you can follow the steps above to quickly update your skill to use APL.

Adding APL to your skill will result in a delightful and immersive experience for Alexa customers with screen devices. You will be able to provide customized experience for devices of different sizes, from Echo Spot to Fire TV. To learn more and get started with APL faster, check out this Java sample skill that uses APL.