Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Navigation in Modular Applications with Deep Linking

Navigation in Modular Applications with Deep Linking

Android engineering has come a long way. Nowadays most applications are modularized to a certain degree - to combat high compile times, enforce separation of concerns or to group code based on certain scopes.

In this talk we will take a look at navigation in modularized apps. Navigation in Android can be done explicitly by passing the class variable or implicit by sending an Intent with a certain configuration. Since modularization is supposed to simplify our dependency graph, we will take a closer look at deep linking as a navigation pattern and compare different approaches like Intent filter, a custom deeplink processor or the Android Jetpack Navigation component.

Damian Burke

July 03, 2019
Tweet

Other Decks in Programming

Transcript

  1. Single Module app Easy access to everything. Scoping with modifiers

    (public, private, protected, …) and packages.
  2. Modularization by Layer app domain data ... Layers work on

    a need-to-know basis. Easy to build for different targets (mobile, wearOS, TV).
  3. View Groups and Views Or use one of the view-based

    frameworks like… - Conductor - Scoop
  4. Modularization by Feature app dashboard profile core All possible targets

    can be made available by adding the dependency. newsfeed
  5. Modularization by Feature… with Dynamic Delivery app dashboard profile core

    Sometimes the newsfeed module is there, sometimes it’s not. newsfeed
  6. 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)
  7. 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)
  8. 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 ? ?
  9. 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 ?
  10. Modularization: The tough part with dynamic features Fully qualified class

    names as Strings… just doesn’t feel right. dashboard newsfeed
  11. 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
  12. 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}
  13. 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 <deepLink app:uri="myapp://newsfeed" />
  14. 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/