Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
APL使ってみた
Search
gaomar
December 17, 2018
Technology
1
1.1k
APL使ってみた
APL(Alexa Presentation Language)使ってみた。
スマートスピーカーを遊びたおす会 vol.4の登壇資料です。
gaomar
December 17, 2018
Tweet
Share
More Decks by gaomar
See All by gaomar
PAD・enebular・Lexで 交通費を確認してみた / enebular-200902
gaomar
0
170
よくあるご質問をノーコードで試してみた / enebular-210210
gaomar
0
160
enebularで湯婆婆をノーコードで実装してみた / enebular-201201
gaomar
0
890
CLOVA OCRをenebularで連携してみた / yurufuwaml-201104
gaomar
0
330
会社の受付システムをenebularでやってみる / 0yenRPA-201006
gaomar
0
180
ゆるふわマシンラーニング vol.4 / yurufuwaml-200702
gaomar
0
220
Makecode Arcadeハンズオン資料 / makecodearcade-0625
gaomar
2
430
M5StickCをLINE Beacon化してみた / m5stack-200207
gaomar
0
700
スマートスピーカーミーティング 20200130 / ssmtg-200130
gaomar
0
400
Other Decks in Technology
See All in Technology
Terraform Stacks入門 #HashiTalks
msato
0
360
TypeScript、上達の瞬間
sadnessojisan
46
13k
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
Lambdaと地方とコミュニティ
miu_crescent
2
370
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
150
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
100
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Navigating Team Friction
lara
183
14k
Building Applications with DynamoDB
mza
90
6.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Scaling GitHub
holman
458
140k
Being A Developer After 40
akosma
87
590k
Transcript
"1-ͬͯΈͨ
ࣗݾհ ॴଐɿגࣜձࣾΞΠΤϯλʔɹେࡕࢧళ ɹɹɹ3%ɹೖࣾ ɹɹɹςΫχΧϧνʔϑظؒ.71 ɹɹɹεϚʔτεϐʔΧʔΤόϯδΣϦετ ۀɿΧʔϦϯάࢧԉπʔϧ։ൃ ɹɹɹεϚʔτεϐʔΧʔݚڀ։ൃ ɹɹɹ)PMP-FOTݚڀ։ൃ ߴഅɹయ !HBPNBS
͖ͳݴ༿ɿͶ͐$MPWB ͔ͨ͏·ɹͻΖͷΓ
ࣗݾհ εϚʔτεϐʔΧʔΞϓϦ։ൃೖ େධൃചதʂ
"1-ͱ
"1- "MFYB1SFTFOUBUJPO-BOHVBHF "1-ͱ &DIP4IPX&DIP4QPUͳͲͷը໘͖σόΠεͰ ը໘ͷϨΠΞτΛ։ൃऀ͕ࣗ༝ʹσβΠϯͰ͖Δ৽͍͠σβΠϯݴޠ
"1-Λ༗ޮԽ
"1-Λ༗ޮԽ "1-Λ༗ޮԽ
"1-σβΠϯπʔϧ
"1-ͷσβΠϯϨΠΞτը໘ "1-σβΠϯπʔϧ ը໘දࣔʢϕʔλʣΛΫϦοΫ
"1-ͷσβΠϯϨΠΞτը໘ "1-σβΠϯπʔϧ छྨͷςϯϓϨʔτ͕͋Δ
"1-σβΠϯπʔϧ ϨΠΞτฤूϞʔυͱ+40/ฤूϞʔυ͕͋Δ ͜͜ͰΓସ͑Δ
දࣔϋϒ
දࣔϋϒΓସ͑ දࣔϋϒ খܕϋϒ &DIP4QPU େܕϋϒ &DIP4IPXOE தܕϋϒ &DIP4IPXTU େܕϋϒ 'JSF57
දࣔϋϒ BMFYBWJFXQPSUQSPpMFTΛΠϯϙʔτ͢Δ "import":[ { "name": "alexa-viewport-profiles", "version" : "1.0.0" }
]
දࣔϋϒ ֤ը໘ͷผ ϏϡʔϙʔτϓϩϑΝΠϧͰߦ͏ "when": "${@viewportProfile == @hubRoundSmall}" IUUQTEFWFMPQFSBNB[PODPNKBEPDTBMFYBQSFTFOUBUJPOMBOHVBHFBQMBMFYBWJFXQPSUQSPpMFTQBDLBHFIUNM @hubRoundSmallɿEcho Spot
@hubLandscapeMediumɿEcho Show (1st) @hubLandscapeLargɿEcho Show (2nd) @tvLandscapeXLargeɿFire TV
λονॲཧ
λονॲཧ ը૾λονʹԠͤ͞Δ߹ λον͢Δͱݩͷը໘ʹΓ͍ͨ
λονॲཧ 5PVDI8SBQQFS λονϥούʔ Λ͏ { "type": "TouchWrapper", "onPress": { "type":
"SendEvent", "arguments": [ "top" ] }, "item": { "type": "AlexaHeader", "headerTitle": "@skillName", "headerAttributionImage": "@skillIcon" } } ɾUZQF5PVDI8SBQQFSΛࢦఆ ɾPO1SFTTͰԠͤ͞Δ ɾBSHVNFOUTͰ͍ͨ͠ύϥϝʔλʔΛࢦఆ ɾJUFN͕Ԡ͢Δର IUUQTEFWFMPQFSBNB[PODPNKBEPDTBMFYBQSFTFOUBUJPOMBOHVBHFBQMUPVDIXSBQQFSIUNM
λονॲཧ "4, "MFYB4LJMMT,JU Ͱͷड͚औΓํ // ը໘λονॲཧ const TouchEventHandler = {
canHandle(handlerInput) { return ((handlerInput.requestEnvelope.request.type === 'Alexa.Presentation.APL.UserEvent' && (handlerInput.requestEnvelope.request.source.handler === 'Press' || handlerInput.requestEnvelope.request.source.handler === 'onPress'))); }, handle(handlerInput) { let choice = handlerInput.requestEnvelope.request.arguments[0]; var speechText = “”; if (choice === 'top') { // λΠτϧΔ speechText = “λΠτϧΔΑ”; } else if (choice === 'game_word') { // ΧʔϦϯά༻ޠදࣔ speechText = “ΧʔϦϯά༻ޠը໘ߦ͘Α”; } else { // ͦͷଞ speechText = “ͦͷଞͩΑ”; } return handlerInput.responseBuilder .speak(speechText) .getResponse(); } }; ɾUZQF"MFYB1SFTFOUBUJPO"1-6TFS&WFOU ɾIBOEMFSʹʮ1SFTTʯ͔ʮPO1SFTTʯ͕ೖΔ ɾBSHVNFOUTͷྻΛऔಘ
Ϧετॲཧ
Ϧετॲཧ ϦετΛදࣔͤ͞Δ߹
Ϧετॲཧ 4FRVFODF γʔΫΤϯε Λ͏ { "type": "Sequence", "scrollDirection": "horizontal", "data":
"${listData}", "height": "100%", "width": "100%", "numbered": true, "item": [ { … } ] } ɾUZQF4FRVFODFΛࢦఆ ɾTDSPMM%JSFDUJPOͰํΛࢦఆ IPSJ[POUBMԣ͖WFSUJDBMॎ͖ ɾEBUBͰϦετදࣔ͢ΔݩσʔλΛ͢ ɾOVNCFSFE͕USVFͳΒࣗಈ࠾൪͢Δ \PSEJOBM^ʹ࠾൪͞Ε͕ͨೖΔ IUUQTEFWFMPQFSBNB[PODPNKBEPDTBMFYBQSFTFOUBUJPOMBOHVBHFBQMTFRVFODFIUNM
"1-ద༻ํ๏
"1-ద༻ํ๏ "1-͔ΒίʔυΛॻ͖ग़͠
"1-ద༻ํ๏ EPDVNFOU෦ͱEBUB4PVSDFT෦Λ͚Δ { “document”: { … }, “dataSouces”: { …
} } return handlerInput.responseBuilder .speak(speechText) .addDirective({ type : 'Alexa.Presentation.APL.RenderDocument', version: '1.0', document: require('./document/apl_top.json'), datasources: require('./data/apl_top.json') }) .getResponse(); μϯϩʔυͨ͠KTPOϑΝΠϧ "4,Ͱͷॲཧ BEE%JSFDUJWFʹࢦఆ͢Δ
"1-ҋͷ
"1-ҋͷ ϨΠΞτΤσΟλͰฤू͍ͯ͠Δͱ ͍ͭͷؒʹ͔த͕উखʹมΘΔ
"1-ҋͷ খܕϋϒͷϨΠΞτΛฤूͯ͠ө͞Εͳ͍ͬͯࢥͬͨΒ தܕϋϒଆͷϨΠΞτΛฤू͍ͯͨ͠X
"1-ҋͷ EBUBTPVSDFT͜͏͠ͳ͍ͱΤϥʔʹͳΔ ʢ-BNCEB4VDDFTTͰฦ͖͔ͬͯͨΒ༨ܭϋϚͬͨʜʣ { "listPage": { "listData": [ { "text":
"1ͭΊ" }, { "text": "2ͭΊ" }, { "text": "3ͭΊ" } ] } } { "listData": [ { "text": "1ͭΊ" }, { "text": "2ͭΊ" }, { "text": "3ͭΊ" } ] } 0,ύλʔϯ /(ύλʔϯ
"1-ҋͷ λονॲཧ͕γϛϡϨʔλʔͱ࣮ػͰ ҧ͏IBOEMFS͕"4,ʹདྷΔ handlerInput.requestEnvelope.request.source.handler === 'Press' ࣮ػͷ߹ύλʔϯ handlerInput.requestEnvelope.request.source.handler === 'onPress'
γϛϡϨʔλʔͷ߹ύλʔϯ
"1-ҋͷ ը໘͖ͷ߹SFQSPNQU ແ͍΄͏͕͍͍ SFQSPNQU͕͋Δͱɺ੨͍όʔ͕ޫͬͯΛड͚͚Δঢ়ଶʹͳΔ XJUI4IPVME&OE4FTTJPOͰ໌ࣔతʹऴྃͤ͞ΒΕΔͷͰɺ ձΛऴྃͤ͞Δ߹ͦͪΒΛ͏
·ͱΊ
·ͱΊ ɾίϯιʔϧͷΠϯλʔϑΣʔε͔Β"1-Λ༗ޮʹ͢Δ ɾछྨͷදࣔϋϒ͕͋Δ খܕதܕେܕେܕ ɾදࣔϋϒͷผϏϡʔϙʔτϓϩϑΝΠϧΛ͏ ɾλονॲཧ5PVDI8SBQQFSΛ͏ ɾϦετॲཧ4FRVFODFΛ͏ ɾ"1-KTPOͷੜσʔλΛฤू͢͠ ɾ࣮ػͷ֬ೝඞͣߦ͏ʂ
·ͱΊ ৄࡉ2JJUBʹ·ͱΊ͍ͯ·͢ IUUQTRJJUBDPNIUBLBVNBJUFNTGEFCBE
ࠂ
ܰҪࠃࡍΧʔϦϯάબखݖେձ ʹͯలࣔ͠·͢ʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ I — APL