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
JavaScriptから デバイスの力を100%引き出すための Web APIとCapacit...
Search
Masahiko Sakakibara
November 19, 2022
Programming
0
470
JavaScriptから デバイスの力を100%引き出すための Web APIとCapacitor入門 / power_from_javascript
Masahiko Sakakibara
November 19, 2022
Tweet
Share
More Decks by Masahiko Sakakibara
See All by Masahiko Sakakibara
プライベートプロダクト戦略 - フロントエンドカンファレンス沖縄 / private_product_frontend
rdlabo
3
4.2k
GitHubをCMSとして使う話/ using_github_as_CMS
rdlabo
0
350
Capacitor4_release
rdlabo
0
580
Web技術で稼ぐため選択肢を俯瞰しよう/options_to_earn_web_technology
rdlabo
0
110
Ionicモバイルアプリ制作入門/get_started_with_ionic
rdlabo
0
96
JavaScript から デバイスの力を 100%引き出すための Capacitor と Angular でのはじめかた。
rdlabo
2
1.7k
JavaScriptとSwift&JavaをつなげるCapacitorと、これからのWeb Frontend/Linking JavaScript with Swift&Java, And the future of Web Frontend.
rdlabo
0
3.6k
NestJSを活用したREST APIサーバ/REST_API_SERVER_BY_NESTJS
rdlabo
0
1.4k
事例からみるアプリデザインの成長戦略とWeb Native Platform/app_design_growth
rdlabo
1
780
Other Decks in Programming
See All in Programming
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Jakarta EE meets AI
ivargrimstad
0
690
Ethereum_.pdf
nekomatu
0
470
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Jakarta EE meets AI
ivargrimstad
0
150
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
CSC509 Lecture 09
javiergs
PRO
0
140
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
C++でシェーダを書く
fadis
6
4.1k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
The Language of Interfaces
destraynor
154
24k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
It's Worth the Effort
3n
183
27k
Building an army of robots
kneath
302
43k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Transcript
+BWB4DSJQU͔ΒσόΠεͷྗΛҾ͖ग़ͨ͢Ίͷ 8FC"1*ͱ$BQBDJUPSೖ
ࣗݾհ ࡗݪণ Ұൠࣾஂ๏ਓϦϨʔγϣϯσβΠϯ ݚڀॴදཧࣄ Ұൠࣾஂ๏ਓΤϦΞɾ ΠϊϕʔγϣϯɾΞϥΠΞϯε$50 *POJD+BQBO6TFS(SPVQ
ද
UJQTZT
৯දࣔҹ εϚϗͱϓϦϯλ͚ͩͰ৯දࣔϥ ϕϧΛͭ͘ΕΔຊॳͷઐ༻ΞϓϦ
XJOFDPEF ଟछྨଟྔͷϫΠϯΛෳڌͰཧͰ ͖Δຊ།ҰͷΞϓϦɻ
*POJD%FWFMPQFS&YQFSU
4USJQF$PNNVOJUZ&YQFSU
ϒϥβػೳ੍ݶΛड͚͍ͯΔɻ
ΞϓϦ͕ར༻Ͱ͖Δ$BQBCJMJUJFT ϞόΠϧσόΠεɺΞϓϦͰར༻Ͱ͖Δແͷ"1*Λఏڙɻ ྫʣ9DPEFͰ໌ࣔతʹڐՄ͕ඞཁͳ$BQBCJMJUJJFT
ΞϓϦ͕ར༻Ͱ͖Δ"1* NSCameraUsageDescription NSPhotoLibraryAddUsageDescription NSPhotoLibraryUsageDescription <uses-permission android:name="android.permissi on.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permissi on.WRITE_EXTERNAL_STORAGE"
/> Χϝϥ ৼಈ NSLocationAlwaysUsageDescription NSLocationWhenInUseUsageDescription <uses-permission android:name="android.permission .ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission .ACCESS_FINE_LOCATION" /> <uses-feature android:name="android.hardware.l ocation.gps" /> ετϨʔδ ϑΝΠϧγεςϜ ϓογϡ௨ Ґஔใ
ϞόΠϧσόΠεΛ௨ͯ͠֎෦σόΠεΛ੍ޚ͢Δ͜ͱՄೳ
ϞόΠϧϒϥβҰ෦ػೳ͕ڐՄ͞ΕͨʮΞϓϦʯ ΞϓϦʹڐՄ͞ΕΔσόΠεͷػೳ܈ ͦͷҰ෦͕ڐՄ͞Εͨϒϥβ 8FCΞϓϦϒϥβ"1*Λ௨ͯ͠ ͦͷҰ෦ͷػೳʹΞΫηε͍ͯ͠Δ ˣ Χϝϥ Ґஔใ ετϨʔδ
18"8FCαΠτͰΞϓϦͷΑ͏ʹৼΔ͍͍ͨʂ
18"ʢ1SPHSFTTJWF8FC"QQTʣϗʔϜʹՃ
18"ʢ1SPHSFTTJWF8FC"QQTʣ௨ΦϑϥΠϯ wϒϥβͷ֎͔ΒϢʔβ͕ΞΫηεͰ͖ ΔʢϗʔϜʹՃʣ wΞΫςΟϒ͡Όͳ͍ͷʹϢʔβʹΞΫ γϣϯ͕Ͱ͖Δʢϓογϡ௨ʣ wΦϯϥΠϯ͡Όͳ͍ͷʹར༻Ͱ͖Δ ࣌ɺʮ৽͍͠8FCʯͩͬͨɻ
8FC64#"1*8FC#MVFUPPUI"1* U i n t 8 A r r a
y . o f ( 0 x 0 0 , 0 x 0 0 , 0 x f f , 0 x f f , 0 x f f , 0 x 0 3 , 0 x 0 0 , 0 x f d , 0 x d 6 , 0 x 2 a , 0 x 0 1 , 0 x f f , 0 x 0 0 ) パケットを自分で組み立 てれたら楽しいかも?!
ͳ͓ɺ4BGBSJͰඇରԠɻ
ͳ͓ɺ4BGBSJͰඇରԠɻ "QQMFɺϓϥΠόγʔอޢͷ؍͔Β4BGBSJ ʹͷ8FC"1*Λ࣮͢Δ͜ͱΛஅ೦
.E/8FC"1*௨"1*Ͱݴٴ͋ΔϨϕϧ
ͳͥɺҰ෦͔͠ڐՄ͞Εͳ͍ɹˠɹ8FCΞϓϦ͕৹ࠪΛड͚͍ͯͳ͍͔Β w ੍ݶ͞Ε͍ͯΔίϯςϯπ w ͳΓ͢·͠ w తࡒ࢈ݖ w ϓϥΠόγʔɺٗɺෆਖ਼ར༻ w
ऩӹԽͱࠂ w ετΞͷܝࡌใͱϓϩϞʔγϣϯ w εύϜͱ࠷ݶͷػೳ w ϚϧΣΞ w ϞόΠϧͷ·͘͠ͳ͍ιϑτΣΞ w ϑΝϛϦʔ IUUQTQMBZHPPHMFDPNBCPVU EFWFMPQFSDPOUFOUQPMJDZ
$BQBDJUPS8FCαΠτΛΞϓϦʹͪ͠Ό͍͍͑͡Όͳ͍
ΞϓϦͱͯ͠৹ࠪΛड͚ΔͨΊʹϒϥβΛཧղ͢Δ εςʔλεόʔ 8FC7JFX 63-όʔ σόΠε04͕දࣔɻΞϓϦϨϕϧͰ ৭Λมߋͨ͠ΓɺඇදࣔʹͰ͖Δɻ ϒϥβΞϓϦ͕දࣔɻ63-͔Βऔಘ͠ ͨΞηοτΛϨϯμϦϯά͢Δɻ63-Λ ೖྗ͢Δ͜ͱͰͲΜͳαΠτදࣔͰ͖ ͯ͠·͏ɻ
ϒϥβΞϓϦ͕දࣔɻ
ΞϓϦʹ͢Δͱ͍͏͜ͱɻ 8FC7JFXͷΞϓϦΛͭ͘Δɻ ʢ04ʹσϑΥϧτࡌʣΛ͛ͯɺ ϩʔΧϧʹ͋Δ8FCΞηοτΛදࣔɻ ˞֎෦ίϯςϯπͷ߹ɺ৹ࠪΛड͚ͯ ͍ͳ͍ୈࡾऀͷίϯςϯπ͕දࣔͰ͖ɺ ಉ༷ʹ"1*੍ݶ͕ೖΔͨΊɻ 8FC7JFX
"1*ΞΫηεͷߟ͑ํ J04 "OESPJE J04"1*܈ "OESPJE"1*܈ 4XJGU0CKFDUJWF$$$ +BWB,PUMJO$$ +4&YQPSU +BWB4DSJQU$PSF +BWB4DSJQU*OUFSGBDF
+BWB4DSJQU +BWB4DSJQU
+BWB4DSJQU$PSF+BWB4DSJQU*OUFSGBDFͱ +4&YQPSU +BWB4DSJQU$PSF +BWB4DSJQU*OUFSGBDF +BWB4DSJQU +BWB4DSJQU 8JOEPXؔ 8JOEPXؔ 8FC7JFX࡞࣌ʹ8JOEPXؔʹՃ
ͭ·Γ ͜ΕͰ৹ࠪ௨Εɺ"1*͍͍ͨ์ɻ ΑΓϢʔβʹՁ͋ΔػೳΛʂ
$BQBDJUPS
8FCΞϓϦΛΫϩεϓϥοτϑΥʔϜʹϒϦοδͤ͞Δ 888 8FCΞϓϦ $BQBDJUPS
w ʮΞϓϦʯͱ͍͏8FC7JFXΛ ͬͯɺ-PDBMͷ8FCΞηοτΛ දࣔ w /BUJWFػೳʹΞΫηε͢ΔͨΊ ͷ"1*͕ར༻Ͱ͖Δ $BQBDJUPSΞϓϦͷΈ
όʔδϣϯཧωΠςΟϒϑΝΠϧͷߏʢJ04ͷ߹ʣ 8FCΞηοτ͚ͩ͜͜ ϓϥάΠϯ1PE fi MFͰཧ
8FCΞϓϦ͘ͳ͍ɻ͚Ͳ͘ͳ͍ɻ h t t p s : / / v
i m e o . c o m / 5 5 4 8 6 6 8 4
5IF4UBUFPG+4
1SPHSFTTJWF8FC"QQT wϞόΠϧͷར༻࣌ؒ૿Ճ wεϚϗΞϓϦͷ৽نΠϯετʔϧ ʢϲ݄ʣ w͔ͭεϚϗΞϓϦ501͕ಠ wεϚϗΞϓϦʹൺͯɺ8&#ഒͷτϥϑΟοΫ w͍Ζ͍Ζͳ8&#ʹ๚͞ΕΔ
1SPHSFTTJWF8FC"QQT ΞϓϦΛར༻͢ΔͷʹɺϢʔβ ̍ɽΞϓϦετΞʹભҠͯ͠ ̎ɽΞϓϦΛΠϯετʔϧͯ͠ ̏ɽΞϓϦΛىಈ͠ͳ͍ͱ͍͚ͳ͍
͏ϓϥοτϑΥʔϜϢʔβ͕ܾΊΔɻ
5IFBOTXFS JOBOVUTIFMM JTCFDBVTFUIBU`TXIFSFUIFTBSF 5IFBOTXFS JOBOVUTIFMM JT CFDBVTFUIBU`TXIFSFUIFT BSF ͑؆୯ɻͦ͜ʹϢʔ β͕͍Δ͔ΒͰ͢ɻ
ʮͲ͏ͭ͘Δ͔ʯͰͳ͘ɺʮԿΛͭ͘Δ͔ʯʹྗ͠Α͏