Welcome to Display Interface Guide. The Display interface guide is a tutorial-style Alexa Skill that showcases the features of the Amazon Echo Show. It is written in Java using the Alexa Skills Kit Java SDK.
This skill shows how to create a Lambda function for handling Alexa Skill requests and sending responses in Echo Show with:
- Render templates: 4 body templates and 2 list templates.
- Inline images: each template allows different sizes of the image.
- Videos: display and watch the video.
- Selection by voice and touch: select an item in the list either by voice or by touch.
- Action tag: create a clickable text.
- Hints: include a hint text.
To run this example skill you need to do two things. The first is to deploy the example code in lambda, and the second is to configure the Alexa skill to use Lambda.
- Go to the AWS Console and click on the Lambda link. Note: ensure you are in us-east or you wont be able to use Alexa with Lambda.
- Click on the Create Function button.
- Click Author from scratch.
- In Configure triggers, add Alexa Skill kit as trigger.
- Name the Lambda Function "Display-Interface-Guide-Skill".
- Select the runtime as Java 8.
- Build a jar file to upload it into the lambda function. There are two ways:
- Using maven: go to the directory containing pom.xml, and run 'mvn assembly:assembly -DdescriptorId=jar-with-dependencies package'. This will generate a zip file named "displaytutorial-1.0-jar-with-dependencies.jar" in the target directory.
- Using gradle: go to the directory containing build.gradle, and run 'gradle fatJar'. This will generate a zip file named "displaytutorial-fat-1.0.jar" in the build/libs directory.
- Select Code entry type as "Upload a .ZIP file" and then upload the jar file created in step 7 from the build directory to Lambda.
- Set the Handler as com.amazon.asksdk.displayguide.DisplayGuideRequestStreamHandler (this refers to the Lambda RequestStreamHandler file in the zip).
- Choose an existing role - lambda_basic_execution.
- Leave the Advanced settings as the defaults.
- Click "Next" and review the settings then click "Create Function".
- Copy the ARN from the top right to be used later in the Alexa Skill Setup.
- Go to the Alexa Console and click Add a New Skill in Alexa link.
- Set "Display interface Guide" as the skill name and "Display Guide" as the invocation name, this is what is used to activate your skill. For example you would say: "Alexa, Ask Display Guide to show me how to play a video."
- Select the Lambda ARN for the skill Endpoint and paste the ARN copied from above. Click Next.
- Copy the custom slot types from the customSlotTypes folder. Each file in the folder represents a new custom slot type. The name of the file is the name of the custom slot type, and the values in the file are the values for the custom slot.
- Copy the Intent Schema from the included IntentSchema.json.
- Copy the Sample Utterances from the included SampleUtterances.txt. Click Next.
- Go back to the skill Information tab and copy the appId. Paste the appId into the DisplayGuideRequestStreamHandler.java file for the variable supportedApplicationIds, then update the lambda source zip file with this change and upload to lambda again, this step makes sure the lambda function only serves request from authorized source.
- You are now able to start using your sample skill! You should be able to go to the Echo webpage and see your skill enabled.
- In order to test it, try to say some of the Sample Utterances from the Examples section below.
- Your skill is now saved and once you are finished testing you can continue to publish your skill.
User: "Alexa, ask display guide to show me topics I can learn about"
User: "how do I use a template"
User: "how do I play a video"
User: "how do I show an image inline with text"
User: "how do I include an action tag"
User: "how do I handle selection of list items"
User: "how do I use a hint"