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
WebView😇😇😇
Search
Keishin Yokomaku
November 28, 2017
Technology
0
770
WebView😇😇😇
Keishin Yokomaku
November 28, 2017
Tweet
Share
More Decks by Keishin Yokomaku
See All by Keishin Yokomaku
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
420
Build apps for Cars
keithyokoma
0
370
Save the state
keithyokoma
0
430
Either in Kotlin
keithyokoma
0
410
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
4.7k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
4.5k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
460
DX Improvements
keithyokoma
3
360
Get Things Done with Gradle Custom Tasks
keithyokoma
1
93
Other Decks in Technology
See All in Technology
Secrets of a PowerShell "Guru"
guyrleech
1
120
コードファーストの考え方。 Amplify Gen2から学ぶAWS次世代のWeb開発体験
yoshiitaka
2
580
「知的単純作業」を自動化する、地に足の着いた大規模言語モデル (LLM) の活用
nrryuya
8
7.4k
知識と実践を紡ぐGenAI / Connecting Knowledge and experience with GenAI
aki_moon
2
110
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
35k
データ分析力を高めるSQL研修サービス『SQL Everyone』
hikarut
1
320
Databricksの生成AI戦略
taka_aki
1
260
CockroachDB はどのくらい「しぶとい」のか? / How tough is CockroachDB?
kota2and3kan
13
4.8k
実例で紹介するRAG導入時の知見と精度向上の勘所
yamahiro
7
2.7k
IaCからAWSに入門した初心者が CloudFormationを通して考えた「AWS操作」の使い分け
maimyyym
3
660
Prisma ORMを2年運用して培ったノウハウを共有する
tockn
18
4.5k
Observabilityジャーニーを実現するためのAWSサービス:CloudWatch編
o11yfes2023
0
120
Featured
See All Featured
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
The Pragmatic Product Professional
lauravandoore
26
5.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
275
13k
Embracing the Ebb and Flow
colly
80
4.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Teambox: Starting and Learning
jrom
128
8.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Transcript
WebView Keishin Yokomaku (@KeithYokoma) / potatotips #45
WebView Keishin Yokomaku 2 potatotips #45 Drivemode, Inc. / Principal
Engineer @KeithYokoma: GitHub / Twitter / Qiita / Tumblr / Stack Overflow
3 WebView
WebView Կ͔ͱ᠘ͷଟ͍ WebView ▸ Θ͔Δ ▸ ੲSIGSEGVβϥͩͬͨཕݪͷΑ͏ͳͷ 4 potatotips #45
WebView ChromeCustomTabs ͕͋Δ͔Β WebView ͍Βͳ͍ࢠ ▸ ͦΜͳ;͏ʹߟ͍͑ͯͨ࣌ظ͕Θͨ͠ʹ͋Γ·ͨ͠ 5 potatotips #45
WebView ·ͩ WebView Ͱফ͍ͯ͠Δͷʁ ▸ Θ͍ͨͯ͠͠·͢ 6 potatotips #45
WebView ࠓͷ WebView ᠘Ϩγϐ ▸ e.g. ๏తใΛ WebView Ͱදࣔ͢Δ ▸
assets ʹ html Λஔ͍ͯ WebView ʹಡ·ͤΔ ▸ ֎෦ϦϯΫ͕ͳ͚Ε࠷खܰʹࡁ·ͤΒΕΔ ▸ ಉ͡ assets ͷ html ʹϦϯΫ͢Δ߹؆୯ ▸ e.g. file:///android_asset/privacy_policy.html 7 potatotips #45
WebView StrictMode ▸ ThreadPolicy ͱ VmPolicy ▸ ͋Γ͕ͪͳ࣮ͷؒҧ͍Λݕग़ͯ͠ϩάग़ྗΫϥογϡΛൃੜͤ͞Δ ▸ ϝΠϯεϨουͰ
I/O ▸ Ϧιʔεͷ close Ε ▸ ΧελϜ͢Δͱ͖ඞཁͳͷͯ͢Λ༗ޮʹ͢Δ ▸ ༗ޮʹͯ͠ͳ͍ͷεϧʔ͞ΕΔ 8 potatotips #45
WebView Android Nougat ͷηΩϡϦςΟ༷ ▸ FileUriExposureException ▸ File εΩʔϚͷ Uri
Λ Intent ʹ͍Εͯڞ༗Ͱ͖ͳ͘ͳͬͨ ▸ FileProvider ͷ ContentProvider Ͱڞ༗͢Δ ▸ StrictMode ʹΦϓγϣϯ͕͋Δ ▸ VmPolicy#penaltyDeathOnFileUriExposure() 9 potatotips #45
WebView WebView#loadUrl() ͷ༷ ▸ WebViewClient Λࢦఆͨ͠ͱ͖ ▸ shouldOverrideUrlLoading ͕ true:
ΞϓϦͰಡΈࠐΈΛཧ ▸ shouldOverrideUrlLoading ͕ false: WebView ͕ಡΈࠐΈΛཧ ▸ WebViewClient Λࢦఆ͠ͳ͍ͱ͖ ▸ ActivityManager ʹ͍߹ΘͤͯదͳͷΛݺͼग़͢ 10 potatotips #45
WebView WebView#loadUrl() ͷ༷ ▸ WebViewClient Λࢦఆͨ͠ͱ͖ ▸ shouldOverrideUrlLoading ͕ true:
ΞϓϦͰಡΈࠐΈΛཧ ▸ shouldOverrideUrlLoading ͕ false: WebView ͕ಡΈࠐΈΛཧ ▸ WebViewClient Λࢦఆ͠ͳ͍ͱ͖ ▸ ActivityManager ʹ͍߹ΘͤͯదͳͷΛݺͼग़͢ 11 potatotips #45
WebView ActivityManager ʹ͍߹ΘͤͯదͳͷΛݺͼग़͢ ▸ Intent Λ͛ͯϋϯυϧͯ͘͠ΕΔΞϓϦΛ୳͢ ▸ ଘࡏ͢ΕͦͪΒʹ͢ ▸ ଘࡏ͠ͳ͚Ε
WebView ͕ϋϯυϧ͢Δ ▸ ͍ͣΕʹͯ͠ Intent ʹಡΈࠐΉ Uri ͕٧Ίࠐ·ΕΔ 12 potatotips #45
WebView ActivityManager ʹ͍߹ΘͤͯదͳͷΛݺͼग़͢ ▸ Intent Λ͛ͯϋϯυϧͯ͘͠ΕΔΞϓϦΛ୳͢ ▸ ଘࡏ͢ΕͦͪΒʹ͢ ▸ ଘࡏ͠ͳ͚Ε
WebView ͕ϋϯυϧ͢Δ ▸ ͍ͣΕʹͯ͠ Intent ʹಡΈࠐΉ Uri ͕٧Ίࠐ·ΕΔ ▸ file:///android_asset/hogehoge.html ͳϦϯΫΛ౿Ήͱ… 13 potatotips #45
14 potatotips #45
WebView WebView Λ͏ͱ͖ͷڭ܇ ▸ WebViewClient Λ͖ͪΜͱ͍·͠ΐ͏ ▸ ֎෦ϦϯΫ JavaScript ͕ͳ͍͔ΒͱݴͬͯԿ͠ͳͯ͘Α͍Θ͚Ͱͳ͍
15 potatotips #45
WebView Keishin Yokomaku (@KeithYokoma) / DroidKaigi 2017
Drivemode We are hiring! 17 potatotips #45
Drivemode We are hiring! 18 potatotips #45
DroidKaigi DroidKaigi 2018 is coming soon! ▸ Ticket: ▸ Early
Bird: 9,800 JPY ▸ Regular: 12,000 JPY ▸ Students: 4,000 JPY 19 potatotips #45