Back to all updates

almost 5 years ago

APL - What the heck is that?

With Alexa Presentation Language (APL), you can build skills with voice and visual experiences that apply conditional layouts and data binding. If you have developed skills for Alexa-enabled devices with a screen, then you are familiar with display templates. You can use APL to create the equivalent of display templates. However, with APL, you have the power and flexibility to build multimodal skills with many visual elements–including graphics, images, and slide shows–and to customize the output for different devices.

With APL, you can create skills with full-featured, responsive, and interactive screen displays, in a manner similar to how you can create Web pages with HTML, CSS, and JavaScript.

APL terminology

See Alexa Design Guide for a discussion of how to use these elements to improve the user experience for your multimodal Alexa skill.

  • Document: A JSON file with the following sections: a list of APL packages to import, definitions for resources, layouts, and styles, and an initial layout to display on the screen. An APL document is what a skill sends to the device.
  • Package: A collection of files with a unique name and version. Packages typically contain one or more APL documents, bitmap images, and vector graphics. Packages are cached on the device for rapid re-use. Each sample included in the authoring tool has a package with a single document.
  • Layout: A visual hierarchy of components that render on the screen. Standard components include text, bitmap images, vector graphics, scrolling regions, and components that position child components relative to each other. Layouts support conditional expansion; portions of the layout hierarchy can be dependent on the screen size/shape or other developer-defined properties. Layouts may include other layouts. Large layouts are built out of individual components and layouts (which inflate into layouts). The use of layouts encourage developers to build libraries of common patterns.
  • Resources: A constant used when drawing text, images, and layouts on the screen. For example, the constant textSizeCaption is the size of the font used to draw image captions. Using a named constant rather than a numerical value allows reuse of an APL document across different devices by providing per-device resource definitions.
  • Styles: A collection of state-dependent resources. For example, the flatButton style defines the size, background color, text color, border color, border width, and border radius of one type of button for the "normal", "pressed", "focused", and "disabled" states. All APL components have a clearly documented list of styled properties.
  • Components: A component is a primitive element that displays on the viewport. A component has various properties that affect its behavior and appearance.
Updating your skill to support APL Important Hackathon Note

Understanding APL is the key to creating a great submission for the Alexa SKills Challenge: Multimodal.  Just a reminder, skills using display interface or display templates are NOT eligible. Your skill must use APL and include at least one APL document to qualify

To learn more about using APL to enhance your skill or to get started, check out the full documentation or head to our resources tab!

Questions?

If you have any questions about the hackathon, please post on the discussion forum.