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
170
enebularで湯婆婆をノーコードで実装してみた / enebular-201201
gaomar
0
910
CLOVA OCRをenebularで連携してみた / yurufuwaml-201104
gaomar
0
340
会社の受付システムをenebularでやってみる / 0yenRPA-201006
gaomar
0
190
ゆるふわマシンラーニング vol.4 / yurufuwaml-200702
gaomar
0
230
Makecode Arcadeハンズオン資料 / makecodearcade-0625
gaomar
2
440
M5StickCをLINE Beacon化してみた / m5stack-200207
gaomar
0
700
スマートスピーカーミーティング 20200130 / ssmtg-200130
gaomar
0
420
Other Decks in Technology
See All in Technology
メールヘッダーを見てみよう
hinono
0
110
Docker Desktop で Docker を始めよう
zembutsu
PRO
0
180
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.5k
FODにおけるホーム画面編成のレコメンド
watarukudo
PRO
2
280
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
ABWGのRe:Cap!
hm5ug
1
120
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
Building Scalable Backend Services with Firebase
wisdommatt
0
110
あなたの人生も変わるかも?AWS認定2つで始まったウソみたいな話
iwamot
3
860
データ基盤におけるIaCの重要性とその運用
mtpooh
4
530
30分でわかる「リスクから学ぶKubernetesコンテナセキュリティ」/30min-k8s-container-sec
mochizuki875
3
450
JuliaTokaiとJuliaLangJaの紹介 for NGK2025S
antimon2
1
120
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.6k
The Invisible Side of Design
smashingmag
299
50k
Site-Speed That Sticks
csswizardry
3
270
Practical Orchestrator
shlominoach
186
10k
Building Adaptive Systems
keathley
38
2.4k
Bash Introduction
62gerente
610
210k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
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