2017-07-16 67 views
0

要將圖像添加到StandardCard卡,我設置了圖片setSmallSourceUrl已棄用?

Image image = new Image();

其中圖片來自com.amazon.speech.ui。各種博客然後說使用image.setSmallSourceUrl和image.setLargeSourceUrl使用 來設置圖像的URL,但這兩個方法在alexa-skills-kit-1.4.0中似乎已被棄用。

此外,似乎有兩個(不兼容)圖像類在玩。一個在com.amazon.speech.ui.Image中,另一個在com.amazon.speech.speechlet.interfaces.display.element.Image中。

1)將兩張圖像添加到StandardCard的正確方法是什麼? 2)StandardCard需要兩種圖像類型中的哪一種?

回答

0

下面顯示響應的格式,

{ 
 
    "version": "1.0", 
 
    "response": { 
 
    "outputSpeech": {"type":"PlainText","text":"output speech"}, 
 
    "card": { 
 
     "type": "Standard", 
 
     "title": "Title", 
 
     "text": "sample test", 
 
     "image": { 
 
     "smallImageUrl": "YourSmallImage here", 
 
     "largeImageUrl": "YourLarge image here" 
 
     } 
 
    } 
 
    }

可以在以下格式提供的圖片:

JPEG 
PNG 

smallImageUrl建議尺寸爲720瓦特X 480H(以像素爲單位)和largeImageUrl推薦尺寸爲1200w×800h(以像素計)