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
810
WebView😇😇😇
Keishin Yokomaku
November 28, 2017
Tweet
Share
More Decks by Keishin Yokomaku
See All by Keishin Yokomaku
One screen, many BottomSheets
keithyokoma
0
210
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
460
Build apps for Cars
keithyokoma
0
410
Save the state
keithyokoma
0
460
Either in Kotlin
keithyokoma
0
450
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
4.8k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
4.7k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
460
DX Improvements
keithyokoma
3
370
Other Decks in Technology
See All in Technology
E2Eテスト自動化プラットフォームにおけるAIの活用
shift_evolve
0
180
サーバーレスAPI(API Gateway+Lambda)とNext.jsで 個人ブログを作ろう!
shuntaka
PRO
0
560
How to Think Like a Performance Engineer
csswizardry
4
590
フルリモートワークはエンジニアの夢を叶えたか? #cm_odyssey
mamohacy
2
600
Git 研修 Basic【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
310
さらに高品質・高速化を目指すAI時代のテスト設計支援と、めざす先 / AI Test Lab vol.1
shift_evolve
0
190
MySQLのロックの種類とその競合
yoku0825
6
1.6k
Luupの開発組織におけるインシデントマネジメントの変遷 ver.RoadtoSRENEXT2024
grimoh
1
270
ゆめみのアクセシビリティの現在地と今後
ryokatsuse
3
290
GoとアクターモデルでES+CQRSを実践! / proto_actor_es_cqrs
ytake
1
150
Github Actions 로 Android 팀의 효율성 극대화
hadonghyun
0
160
Azure Pipelinesを使用したCICDベースラインアーキテクチャ実践
yuriemori
0
190
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Agile that works and the tools we love
rasmusluckow
325
20k
How to name files
jennybc
67
96k
Facilitating Awesome Meetings
lara
46
5.8k
Raft: Consensus for Rubyists
vanstee
134
6.5k
Building Your Own Lightsaber
phodgson
101
5.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
34
1.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
Adopting Sorbet at Scale
ufuk
71
8.8k
Unsuck your backbone
ammeep
666
57k
For a Future-Friendly Web
brad_frost
173
9.2k
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