Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Navigation x Deep Link 結構大変だった話
Search
KKusumi
November 27, 2019
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Navigation x Deep Link 結構大変だった話
KKusumi
November 27, 2019
More Decks by KKusumi
See All by KKusumi
今日から始めるAndroid Unit Test
kkusumi
0
160
Other Decks in Programming
See All in Programming
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
JIS keyboard support in Omarchy
lef237
0
130
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
180
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.5k
golang-bob.pdf
iwatsukayura
0
130
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
Event is what happens
moro
2
860
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Google's AI Overviews - The New Search
badams
0
1.6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Design in an AI World
tapps
1
350
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Prompt Engineering for Job Search
mfonobong
0
520
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
How to build a perfect <img>
jonoalderson
1
6.1k
Transcript
Katsumi Kusumi @ and factory.inc 1 Navigation x DeepLink ݁ߏେมͩͬͨ
About Me 2 • Katsumi Kusumi(@kl_tech) • and factory •
Android App Engineer • ອըΞϓϦ࡞ͬͯ·͢ɻ
3 ࢲ͝ͱͰ͕͢ɺɺɺ
4 ͔͜͜Βຊ
ࠓ͔Β׆͔ͤΔ Jetpack Navigation࣮ํ๏ 5
What is Jetpack Navigation?? 6
Navigationͱ 7 By Android developers documentation • φϏήʔγϣϯͱɺϢʔβʔ͕ΞϓϦͷ༷ʑͳίϯςϯπؒΛҠಈ͢Δૢ࡞ Λࢦ͠·͢ɻ •
Android JetpackͷNavigationίϯϙʔωϯτɺ୯७ͳϘλϯΫϦοΫ͔Βɺ ΞϓϦόʔφϏήʔγϣϯυϩϫʔͳͲͷෳࡶͳύλʔϯ·Ͱɺ͞·͟·ͳφ ϏήʔγϣϯΛ࣮͢Δͷʹཱͪ·͢ɻ • ·ͨɺNavigationίϯϙʔωϯτɺ֬͞Εͨݪଇͷηοτʹै͏͜ͱʹΑ ΓɺҰ؏ੑͷ͋Δ༧ଌ͍͢͠ϢʔβʔΤΫεϖϦΤϯεΛอূ͠·͢ɻ
ʁʁʁ 8
NavigationΛೖΕΔϝϦοτ 9 • ϑϥάϝϯτભҠͷτϥϯβΫγϣϯཧΛͯ͘͠ΕΔ • όοΫϘλϯͷ੍ޚΛͯ͘͠ΕΔ • ը໘ભҠ࣌ͷඪ४ΞχϝʔγϣϯΛఏڙ͍ͯ͠Δ • Deep
LinkΛ؆୯ʹ࣮Ͱ͖Δ • ࠷খݶͷՃ࡞ۀͰɺφϏήʔγϣϯυϩϫʔϘτϜφϏήʔγϣ ϯΛ࣮Ͱ͖Δ • Fragmentؒͷͷड͚͕͠؆୯…ɻͳͲͳͲɻ
NavigationΛೖΕΔϝϦοτ 10 • ϑϥάϝϯτભҠͷτϥϯβΫγϣϯཧΛͯ͘͠ΕΔ • όοΫϘλϯͷ੍ޚΛͯ͘͠ΕΔ • ը໘ભҠ࣌ͷඪ४ΞχϝʔγϣϯΛఏڙ͍ͯ͠Δ • Deep
LinkΛ؆୯ʹ࣮Ͱ͖Δ • ࠷খݶͷՃ࡞ۀͰɺφϏήʔγϣϯυϩϫʔϘτϜφϏήʔγϣ ϯΛ࣮Ͱ͖Δ • Fragmentؒͷͷड͚͕͠؆୯…ɻͳͲͳͲɻ
Navigationͷ Deep Link࣮ํ๏ 11
Navigationͷߏཁૉ 12 NavigationGraph 1. →શͯͷφϏήʔγϣϯؔ࿈ใΛҰͭͷॴͰूதతʹอ͢ΔxmlϦιʔεɻ NavHost 2. →φϏήʔγϣϯάϥϑ͔ΒͷѼઌΛදࣔ͢Δۭͷίϯςφɻ NavController 3.
→NavHostͷΞϓϦφϏήʔγϣϯΛཧ͢ΔΦϒδΣΫτɻ
Navigationͷߏཁૉ 13 NavigationGraph 1. →શͯͷφϏήʔγϣϯؔ࿈ใΛҰͭͷॴͰूதతʹอ͢ΔxmlϦιʔεɻ NavHost 2. →φϏήʔγϣϯάϥϑ͔ΒͷѼઌΛදࣔ͢Δۭͷίϯςφɻ NavController 3.
→NavHostͷΞϓϦφϏήʔγϣϯΛཧ͢ΔΦϒδΣΫτɻ
NavigationGraph 14 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation>
NavigationGraph 15 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation>
NavigationGraph 16 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb” /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Navigation Graphͷఆٛ • ͜ͷதʹ༻͢ΔࢠNavigationGraph FragmentΛՃ͍ͯ͘͠ɻ • startDestinationɿ͜ͷNavigationGraph ʹೖͬͨ࣌ʹॳΊͯදࣔ͢ΔFragment
NavigationGraph 17 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Fragmentͷఆٛ • ͜ͷதʹ༻͢ΔҾɺઃఆ͢Δ Deep LinkͷURLΛهࡌ͢Δɻ
NavigationGraph 18 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination=“@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • ը໘ભҠͷఆٛ • ݱࡏͷFragment͔ΒͲͷFragmentʹભ Ҡ͢Δ͔͕ॻ͔Ε͍ͯΔɻ • ࠓͩͬͨΒSampleA͔ΒSampleB
NavigationGraph 19 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • FragmentͷҾ • Deep Linkͷύϥϝʔλ໊ͱҰக͍ͯ͠ Δඞཁ͕͋Δɻ
NavigationGraph 20 <?xml version="1.0" encoding="utf-8"?> <navigation xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation" app:startDestination="@id/fragment_sample">
<fragment android:id="@+id/fragment_sample" android:name="SampleFragment" android:label="fragment_samplea"> <action android:id="@+id/action_sampleA_to_sampleB" app:destination="@id/fragment_sampleb" /> <argument android:name="arg" app:argType="integer" /> <deepLink app:uri="https://www.google.com?arg={arg}"/> </fragment> </navigation> • Deep LinkͷURL • ͜Εઃఆ͢ΔͱɺϦϯΫ౿Μͩ࣌ʹભҠ Ͱ͖ΔΑ͏ʹͳΔɻ
21 ͳΜͩʂʂͬͺ؆୯͡ΌΜʂʂ
ͪΐͬͱͯɻ
όοΫελοΫ ͬͯͲ͏ͳͬͯΜͷʁʁ
ͷόοΫελοΫ NavigationGraphͷߏʹґଘ͍ͯ͠Δ Navigation x Deep Link
25 NavigationGraphX
26 NavigationGraphX FragmentA
27 NavigationGraphX FragmentA NavigationGraphY
28 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC
29 NavigationGraphX FragmentA FragmentB FragmentC ͜ͷߏͩͱɺόοΫϘλϯΛԡͨ͠߹ଈΞϓϦऴྃʂ
30 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC
31 ͜Εʹͯղܾʂʂ
ͪΐͬͱͯɻ
33 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖Δɻ
34 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖ͳ͍ʂʂ
35 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Deep Linkͬͨ࣌ͷͨΊʹ ֊ߏʹ͠ͳ͍ͱ͍͚ͳ͍ɻ ҧ͏֊ͷFragmentʹ
ભҠͰ͖ͳ͍ ࠈɻ
ແཧ͡ΌΜɻ
37 NavigationGraphX FragmentA NavigationGraphY FragmentB FragmentC Ͱ͖Δʂ ղܾࡦ
ղܾࡦ • Ұ֊ԼͷNavigationʹͳΒભҠͰ͖Δɻ ભҠ͍ͨ͠FragmentΛNavigationͷstartDestinationʹઃఆ͢Δ ҾNavigationʹઃఆ͢Δɻ • startDestinationʹઃఆͨ͠FragmentҎ֎ʹભҠ͍ͨ͠߹ startDestinationʹઃఆͨ͠FragmentͷonCreate()Ͱ ϑϥάΛνΣοΫͯ͠ભҠͤ͞Δɻ →
→
·ͱΊ 39 • NavigationͰDeep LinkΛ࣮͢Δͱ͖ɺ֊ߏΛҙࣝ͢Δɻ →Deep LinkͰભҠͨ࣌͠ʹੵΜͰ͓͍ͯ΄͍͠όοΫελοΫ௨Γʹ࡞Δ • ֊͕ҧ͏FragmentʹભҠͰ͖ͳ͍ɻ →NavigationΛҰճט·ͤͯɺstartDestinationͰભҠ͢Δɻ
• ϥϯλΠϜΤϥʔͰ͔͠ෆ۩߹ΛݕͰ͖ͳ͍ͷͰɺͪΐͬͱଟΊʹςετ ͢Δɻ • ͋ͱ͔Βमਖ਼͢ΔͱେมͳͷͰɺͳΔ͘࠷ॳ͔Β֊Λ࡞͓ͬͯ͘ɻ
͓ΘΓɻ 40