Alexa Presentation Language (APL) Frequently Asked Questions (FAQs)
Note: Watch the replay of Alexa Live ‘22 on demand. Catch the latest on ambient intelligence, smart home, and AI.
The Alexa Presentation Language (APL) is a set of APIs that enable you to publish static characteristics for a device viewport to the Alexa Voice Service (AVS).
- Q: Tablets support multi-touch gestures. What value should I specify for
- Specify a value of
touchfield. This field indicates that the device supports single input mode, not that
SINGLEtouch is the only mode.
- Q: As a Skill developer designing landscape and portrait experiences for tablets, how do I determine the window orientation?
- Unlike Android and other host systems, the
Alexa.WindowAPI doesn't offer explicit constants for orientation because orientation isn't universal across all devices, such as stationary TV sets. If your design requires orientation logic, compare the width and height of the window in your presentation to account for other conditions, such as dynamic window resizing, which can set height greater than width or vice versa.
- Q: How can I represent multiple displays under the
- Instead of using
Alexa.Display, represent multiple displays by expressing them as composite endpoints.
- Q: How would I target a display by name?
- Use endpoints, which include endpoint name in their definitions, to target a display by name.
- Q: I want to render something to a screen; how do I choose appropriate default values?
- For most uses cases, set the
PRIMARYif you are unsure about how to present your content. However, if your content is highly interactive or intended to be the main focus of the device user, set the
STANDARD, if available. For shorter interactions that present a small amount of data, presenting small amounts of data, set the
OVERLAY, if available. You can also use an
OVERLAYwindow to display content on a transparent or semi-transparent background.
- Q: Which window maps to a single viewport?
- Use a value of
preferredUsagefor a single viewport.
- Q: How can I support multi-touch gestures?
- Although APL doesn't support multi-touch gesture expressions, you can add these gestures by creating an extension to the
Alexa.Displaywith interfaces defining types, classes, and fidelity your gestures as needed. For example, to create a pinch-zoom gesture, create an extension to
MULTITOUCHand an additional interface of
PINCHZOOMas a supported property.
- Q: How can I force landscape window orientation from my Skill?
- The published window and display capabilities describe valid window properties, which convert to viewport properties to describe how the window could change. To force a window to landscape, augment an existing directive or create a new directive. For example, you can augment the APL runtime to assert a particular orientation, or you could send a system-level directive, translating to the host system to force landscape for the entire device.
- Q: What's the initial size, configuration, and runtime status for a window?
- Building an adaptable UI with APL doesn't require an initial size, configuration, or runtime status. Starting conditions vary depending on the interaction model for a device.
- Q: How can I tell what the lifetime of a window is?
- Individual device policy determine the lifetime of a window. You can model Window lifetime either through timeout or lifetime policies either explicitly through the
Alexa.InteractionModeinterface or through association, similar to video properties. Because a user might exit a window at any time, you can just process that the user has exited the window.
- Q: Do the APL APIs require certain keyboards?
- The APL APIs don't have specific requirements for keyboard support. However, you must indicate that you support keyboards in your call to AVS.
- Q: How are arc minutes calculated for the API?
- Calculate arc minutes using the interaction mode
interactionDistancefield in combination with the physical size of the display.
- Q: Why are width and height required for circular or round displays?
- Because the
ROUNDexpressions act as masks on top of a square display, Alexa still requires values for the width and height (both physical and pixel) of the square display.
- Q: What video players on a device do the APL APIs support?
- Devices, not APIs, determine video player support.
- Q: How do I set a timeout for a window?
- Use any of the following approaches to set a timeout for a window:
- Create an extension to
- Use a supplementary API that expresses the timeout via rendering directives with
- Create an additional configuration property within the
- Create an extension to
Last updated: Oct 28, 2020