Alexa Auto SDK  3.2.0
Classes | Public Member Functions | Protected Member Functions | List of all members
com.amazon.aace.apl.APL Class Referenceabstract

Classes

enum  ActivityEvent
 

Public Member Functions

void renderDocument (String jsonPayload, String token, String windowId)
 
void clearDocument (String token)
 
void executeCommands (String jsonPayload, String token)
 
void dataSourceUpdate (String sourceType, String jsonPayload, String token)
 
void interruptCommandSequence (String token)
 

Protected Member Functions

final void clearCard ()
 
final void clearAllExecuteCommands ()
 
final void sendUserEvent (String payload)
 
final void sendDataSourceFetchRequestEvent (String type, String payload)
 
final void sendRuntimeErrorEvent (String payload)
 
final void setAPLMaxVersion (String aplMaxVersion)
 
final void setDocumentIdleTimeout (long documentIdleTimeout)
 
final void renderDocumentResult (String token, boolean result, String error)
 
final void executeCommandsResult (String token, boolean result, String error)
 
final void processActivityEvent (String token, ActivityEvent event)
 
final void sendDocumentState (String state)
 
final void sendDeviceWindowState (String state)
 

Detailed Description

APL should be extended to handle receiving Alexa Presentation RenderDocument and ExecuteCommands directives from AVS. These directives contain metadata for rendering or operating on display cards for devices with GUI support. For more information about Alexa Presentation Language (APL) see the interface overview:

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/understand-apl.html

Member Function Documentation

◆ renderDocument()

void com.amazon.aace.apl.APL.renderDocument ( String  jsonPayload,
String  token,
String  windowId 
)

Notifies the platform implementation that a RenderDocument directive has been received. Once called, the client should render the document based on the APL specification in the payload in structured JSON format.

Note
The payload may contain customer sensitive information and should be used with utmost care. Failure to do so may result in exposing or mishandling of customer data.
Parameters
[in]jsonPayloadThe payload of the Alexa.Presentation.APL.RenderDocument directive which follows the APL specification.
[in]tokenThe APL presentation token associated with the document in the payload.
[in]windowIdThe target windowId.

◆ clearDocument()

void com.amazon.aace.apl.APL.clearDocument ( String  token)

Notifies the platform implementation when the client should clear the APL display card. Once the card is cleared, the platform implementation should call clearCard().

Parameters
[in]tokenThe APL presentation token associated with the current rendered document.

◆ executeCommands()

void com.amazon.aace.apl.APL.executeCommands ( String  jsonPayload,
String  token 
)

Notifies the platform implementation that an ExecuteCommands directive has been received.

Parameters
[in]jsonPayloadThe payload of the Alexa.Presentation.APL.ExecuteCommands directive in structured JSON format.
[in]tokenThe APL presentation token associated with the current rendered document.

◆ dataSourceUpdate()

void com.amazon.aace.apl.APL.dataSourceUpdate ( String  sourceType,
String  jsonPayload,
String  token 
)

Notifies the platform implementation of a dynamic data source update. Please refer to APL documentation for more information.

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-data-source.html

Parameters
[in]sourceTypeDataSource type.
[in]jsonPayloadThe payload of the directive in structured JSON format.
[in]tokenThe APL presentation token associated with the current rendered document.

◆ interruptCommandSequence()

void com.amazon.aace.apl.APL.interruptCommandSequence ( String  token)

Notifies the platform implementation that a command execution sequence should be interrupted.

Parameters
[in]tokenThe APL presentation token associated with the current rendered document.

◆ clearCard()

final void com.amazon.aace.apl.APL.clearCard ( )
protected

Notifies the Engine to clear the card from the screen and release any focus being held.

◆ clearAllExecuteCommands()

final void com.amazon.aace.apl.APL.clearAllExecuteCommands ( )
protected

Notifies the Engine to clear all pending ExecuteCommands directives and mark them as failed.

◆ sendUserEvent()

final void com.amazon.aace.apl.APL.sendUserEvent ( String  payload)
protected

Notifies the Engine to send UserEvent event to AVS.

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-interface.html#userevent-request

Parameters
[in]payloadThe UserEvent event payload. The caller of this function is responsible to pass the payload as it defined by AVS.

◆ sendDataSourceFetchRequestEvent()

final void com.amazon.aace.apl.APL.sendDataSourceFetchRequestEvent ( String  type,
String  payload 
)
protected

Notifies the Engine to send a LoadIndexListData event to AVS.

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-interface.html#loadindexlistdata-request https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-data-source.html

Parameters
typeThe type of data source fetch request. The only supported value is "dynamicIndexList".
payloadThe DataSourceFetchRequest event payload. The caller of this function is responsible to pass the payload as defined by AVS.

◆ sendRuntimeErrorEvent()

final void com.amazon.aace.apl.APL.sendRuntimeErrorEvent ( String  payload)
protected

Notifies the Engine to send an APL RuntimeError event to AVS

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-interface.html#runtimeerror-request

Parameters
payloadThe RuntimeError event payload. The caller of this function is responsible to pass the payload as defined by AVS.

◆ setAPLMaxVersion()

final void com.amazon.aace.apl.APL.setAPLMaxVersion ( String  aplMaxVersion)
protected

Set the APL version supported by the runtime component.

Parameters
[in]aplMaxVersionThe APL version supported.

◆ setDocumentIdleTimeout()

final void com.amazon.aace.apl.APL.setDocumentIdleTimeout ( long  documentIdleTimeout)
protected

Set a custom document idle timeout. When the idle timeout is reached, clearDocument will be called.

Parameters
[in]documentIdleTimeoutThe timeout in milliseconds.
Note
Will be reset for every directive received from AVS.

◆ renderDocumentResult()

final void com.amazon.aace.apl.APL.renderDocumentResult ( String  token,
boolean  result,
String  error 
)
protected

Notifies the Engine with the result of a renderDocument notification.

Parameters
[in]tokenThe APL presentation token associated with the current rendered document.
[in]resultRendering result (true on executed, false on exception).
[in]errorError message provided in case result is false.

◆ executeCommandsResult()

final void com.amazon.aace.apl.APL.executeCommandsResult ( String  token,
boolean  result,
String  error 
)
protected

Notifies the Engine with the result of an executeCommands notification.

Parameters
[in]tokenThe APL presentation token associated with the current rendered document.
[in]resultRendering result (true on executed, false on exception).
[in]errorError message provided in case result is false.

◆ processActivityEvent()

final void com.amazon.aace.apl.APL.processActivityEvent ( String  token,
ActivityEvent  event 
)
protected

Notifies the Engine of an activity change event. The APL runtime can report whether the rendered document is active or inactive. If active, the idle timer is stopped and prevents clearDocument. If inactive, the idle timer is started and clearDocument will be called after timer expiration.

Parameters
[in]sourceThe source of the activity event.
[in]eventThe activity change event.

◆ sendDocumentState()

final void com.amazon.aace.apl.APL.sendDocumentState ( String  state)
protected

Notifies the Engine of rendered document state. The format of the state is a JSON string representing the payload object of the RenderedDocumentState sent with APL events.

https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/presentation-apl.html#rendereddocumentstate

Parameters
[in]stateThe visual state of the rendered components.

◆ sendDeviceWindowState()

final void com.amazon.aace.apl.APL.sendDeviceWindowState ( String  state)
protected

Notifies the Engine of the current window state. The format of the state is a JSON string representing the payload object of the WindowState context sent for the Alexa.Display.Window interface.

https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/display-window.html#windowstate-context-object

Parameters
[in]stateThe window state context object.

Alexa Auto SDK 3.2.0 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0