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
880
WebView😇😇😇
Keishin Yokomaku
November 28, 2017
Tweet
Share
More Decks by Keishin Yokomaku
See All by Keishin Yokomaku
One screen, many BottomSheets
keithyokoma
0
360
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
610
Build apps for Cars
keithyokoma
0
500
Save the state
keithyokoma
0
540
Either in Kotlin
keithyokoma
0
560
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
5.1k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
5k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
520
DX Improvements
keithyokoma
3
390
Other Decks in Technology
See All in Technology
アセスメントで紐解く、10Xのデータマネジメントの軌跡
10xinc
1
430
Would you THINK such a demonstration interesting ?
shumpei3
1
220
AWS Control Towerを 数年運用してきての気づきとこれから/aws-controltower-ops-tips
tadayukinakamura
0
150
AI Agentを「期待通り」に動かすために:設計アプローチの模索と現在地
kworkdev
PRO
2
450
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
120
Linuxのパッケージ管理とアップデート基礎知識
go_nishimoto
0
290
DuckDB MCPサーバーを使ってAWSコストを分析させてみた / AWS cost analysis with DuckDB MCP server
masahirokawahara
0
1.3k
watsonx.data上のベクトル・データベース Milvusを見てみよう/20250418-milvus-dojo
mayumihirano
0
120
AIで進化するソフトウェアテスト:mablの最新生成AI機能でQAを加速!
mfunaki
0
140
彩の国で始めよう。おっさんエンジニアから共有したい、当たり前のことを当たり前にする技術
otsuki
0
150
新卒エンジニアがCICDをモダナイズしてみた話
akashi_sn
2
240
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #DevOpsDaysTokyo
takabow
0
380
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
46
14k
Faster Mobile Websites
deanohume
306
31k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Building an army of robots
kneath
304
45k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Applications with DynamoDB
mza
94
6.3k
Building Flexible Design Systems
yeseniaperezcruz
329
38k
Fireside Chat
paigeccino
37
3.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Being A Developer After 40
akosma
91
590k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
The Language of Interfaces
destraynor
157
25k
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