Search code examples
androidalexa-skills-kitalexa-voice-serviceamazon-echo

Android application as new device for Amazon Echo


I spend lest two days for to find something and no result, maybe you can help me.

I'm using Amazon Echo Dot and i want to build some android application which can be controlled by Alexa. So i need to know if it's possible to realize next things:

1) Recognize my application as new smart device by Alexa

2) For example press some button I am my application when i say "Alexa. Switch something in my app"

If it's possible, can somebody provide some links for to documentation?

If i understand correct, when Alexa searching new smart devices in my WiFi network, she send JSON formatted request to each device in network and wait JSON answer. Is it right thing?


Solution

  • I'm using Amazon Echo Dot and i want to build some android application which can be controlled by Alexa.

    It's currently not possible to control a app via Alexa directly.

    If you really just want to use "switch xy on", "switch xy off", then you can create a Smart Home Skill. This Skill is also asked by Alexa to discover the devices. So it can be used to find you phone with the special app.

    More Details: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/steps-to-create-a-smart-home-skill

    But if you want to be more flexible, then you have to create an Alexa Skill which implements the supported voice commands for your app. If one intent in that skill is called by the user or final by the alexa backend systems after finishing the speech recongnition, then you can execute e.g. a rest call to your app backend service or to the Android Notification System to inform your app about that call/user wish.

    The flow should look like this:

    "Alexa start MyFancyApp"
    "Alexa press the green Button"
       --> AWS Lambda "MyFancyApp.PressGreenButton" function is called
       --> MyFancyApp - Backend Service:/User01/GreenButton/press is called
       --> App on you Android Phone is informed and switch the State
       --> AWS Lambda "MyFancyApp.PressGreenButton" receives the status code from app backend and informs the user via the Echo Device: Voice out "green button is pressed".
    

    HowTo: https://developer.amazon.com/blogs/post/TxDJWS16KUPVKO/New-Alexa-Skills-Kit-Template-Build-a-Trivia-Skill-in-under-an-Hour

    Note: You have to use Account Linking on Amazon Alexa to identify the User.