From the latest beta multi-modal SDK (from ask-sdk-core-2.5.0-APL.jar),the follow code running from console/simulator:ViewportProfile viewportProfile = ViewportUtils.getViewportProfile(input.getRequestEnvelope());Results in java.lang.
NullPointerException: null
at com.amazon.ask.request.viewport.
ViewportUtils.getViewportProfile(ViewportUtils.java:25)
at au.com.nablabs.t2n.alexa.
AbstractAlexaIntent.execute(AbstractAlexaIntent.java:114)
at au.com.nablabs.t2n.alexa.request.
AlexaIntentHandler.processIntent(AlexaIntentHandler.java:50)
at au.com.nablabs.t2n.alexa.request.
AlexaIntentHandler.handle(AlexaIntentHandler.java:38)
at com.amazon.ask.dispatcher.request.handler.impl.
DefaultHandlerAdapter.execute(DefaultHandlerAdapter.java:36)
at com.amazon.ask.dispatcher.impl.
DefaultRequestDispatcher.doDispatch(DefaultRequestDispatcher.java:148)
at com.amazon.ask.dispatcher.impl.DefaultRequestDispatcher.dispatch(DefaultRequestDispatcher.java:83)
at com.amazon.ask.
Skill.invoke(Skill.java:89)
at com.amazon.ask.
Skill.invoke(Skill.java:64)
at com.amazon.ask.servlet.
SkillServlet.doPost(SkillServlet.java:102)The reason is that the "Viewport" block is lost from the request when it comes from the console/simulator:{ "Viewport": { "experiences": [ { "arcMinuteWidth": 346, "arcMinuteHeight": 216, or "canRotate": counterfeit,"canResize": counterfeit } ], "shape": "RECTANGLE", or "pixelWidth": 1280,"pixelHeight": 800, "dpi": 160, and "currentPixelWidth": 1280,"currentPixelHeight": 800, "touch": [ "SINGLE" ], and "keyboard": }
}
Source: amazon.com