Slide 1

Slide 1 text

Navigation in Modular Applications Damian Burke Onefootball @damian2048 damian-burke

Slide 2

Slide 2 text

Modularization

Slide 3

Slide 3 text

Single Module app Easy access to everything. Scoping with modifiers (public, private, protected, …) and packages.

Slide 4

Slide 4 text

Modularization by Layer app domain data ... Layers work on a need-to-know basis. Easy to build for different targets (mobile, wearOS, TV).

Slide 5

Slide 5 text

Modularization by Feature app dashboard newsfeed profile core Feature scopes allow parallel work with less conflicts.

Slide 6

Slide 6 text

Modularization Matrix app dashboard-ui core dashboard-domain dashboard-data newsfeed-ui dashboard-domain dashboard-data profile-ui profile-domain profile-data

Slide 7

Slide 7 text

Navigation

Slide 8

Slide 8 text

Multi-Activity and Intent

Slide 9

Slide 9 text

Fragment Transactions

Slide 10

Slide 10 text

View Groups and Views Or use one of the view-based frameworks like… - Conductor - Scoop

Slide 11

Slide 11 text

AndroidX Navigation Component

Slide 12

Slide 12 text

Deep Linking

Slide 13

Slide 13 text

How to Link URI - Uniform Resource Identifier URI Scheme: RFC 3986

Slide 14

Slide 14 text

Surfing the web… Platform independent.

Slide 15

Slide 15 text

Deep Linking

Slide 16

Slide 16 text

Deep Linking Scheme: myapp Host: profile Path: 12345

Slide 17

Slide 17 text

Deep Linking in Action

Slide 18

Slide 18 text

Manually via Android Manifest

Slide 19

Slide 19 text

Deeplink Processor Single Activity to catch-all deeplinks.

Slide 20

Slide 20 text

Deeplink Processor Single Activity to catch-all deeplinks.

Slide 21

Slide 21 text

Deeplink Processor Single Activity to catch-all deeplinks. Passes the link on to a handler.

Slide 22

Slide 22 text

Deeplink Processor Single Activity to catch-all deeplinks. Passes the link on to a processor.

Slide 23

Slide 23 text

Annotation-based Deeplink Processor https://github.com/airbnb/DeepLinkDispatch

Slide 24

Slide 24 text

Annotation-based Deeplink Processor https://github.com/airbnb/DeepLinkDispatch

Slide 25

Slide 25 text

AndroidX Navigation Component

Slide 26

Slide 26 text

Modularization + Navigation

Slide 27

Slide 27 text

Modularization by Feature app dashboard profile core All possible targets can be made available by adding the dependency. newsfeed

Slide 28

Slide 28 text

Modularization by Feature… with Dynamic Delivery app dashboard profile core Sometimes the newsfeed module is there, sometimes it’s not. newsfeed

Slide 29

Slide 29 text

Detour: Dynamic Features app dashboard profile core Google introduced Dynamic Features to further modularize app delivery. Next step after App Bundles. Reverses the module-dependency. newsfeed (injecting functionality)

Slide 30

Slide 30 text

Detour: Dynamic Features app dashboard profile core App has no compile-time dependency on newsfeed. App (or base) doesn’t know about Android components. newsfeed (injecting functionality)

Slide 31

Slide 31 text

Multi-Activity and Intent Now requires a String instead of the class name.

Slide 32

Slide 32 text

Fragment Transactions Now require reflection to create the Fragment instead of a simple constructor or method call.

Slide 33

Slide 33 text

Modularization + Deep Linking

Slide 34

Slide 34 text

Modularization: The tough part with dynamic features Dynamic features are/can be added at runtime. Requires a dynamic navigation. Implementation details might be unknown. app dashboard profile core newsfeed ? ?

Slide 35

Slide 35 text

Modularization: The tough part with dynamic features We could use fully qualified class names and create Intents, but that introduces tight coupling between otherwise independent dynamic features. app dashboard profile core newsfeed ?

Slide 36

Slide 36 text

Modularization: The tough part with dynamic features Fully qualified class names as Strings… just doesn’t feel right. dashboard newsfeed

Slide 37

Slide 37 text

Deep Linking Implementation independent. Descriptive.

Slide 38

Slide 38 text

Modularization: The tough part with dynamic features Deep Linking through via Intents as a decoupled navigation pattern. Good for a decoupled scenario. app dashboard profile core newsfeed intent: myapp://newsfeed/article/123

Slide 39

Slide 39 text

Modularization: The tough part with dynamic features AndroidManifest is still merged. Intent-Filters are alive in dynamic features. Flexible and dynamic. app dashboard profile core newsfeed intent: myapp://newsfeed/article/123 intent-filter: myapp://newsfeed/{type}/{id}

Slide 40

Slide 40 text

Modularization: The tough part with dynamic features AndroidManifest is still merged. Intent-Filters are alive in dynamic features. Flexible and dynamic. app dashboard profile core newsfeed intent: myapp://newsfeed/article/123

Slide 41

Slide 41 text

What’s next?

Slide 42

Slide 42 text

Modularization is hard. Take a look at other approaches. Navigation in Modular Applications with Deep Linking - https://blog.usejournal.com/navigation-in-modular-applicatio ns-with-deep-linking-6a599c11e487 Patterns for accessing code from dynamic feature modules - https://medium.com/androiddevelopers/patterns-for-accessi ng-code-from-dynamic-feature-modules-7e5dca6f9123 Plaid - https://github.com/android/plaid airbnb Deeplink Dispatcher - https://github.com/airbnb/DeepLinkDispatch AndroidX Navigation - https://developer.android.com/guide/navigation/

Slide 43

Slide 43 text

Thank You Onefootball @damian2048 damian-burke (we’re hiring)