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

Everything They Don't Tell You About Instant Apps

Everything They Don't Tell You About Instant Apps

Creating an Android project that is decoupled enough to be able to release an individual feature as an instant app is a tough ask. It becomes even more daunting when your starting point is a monolithic, single module project. In this talk we’ll go over how the Cricket World Cup 2019 app went from a 56MB APK to a 16MB app bundle + 4MB instant app, and we’ll show every single problem we hit along the way.

Jamie Adkins

January 21, 2020
Tweet

More Decks by Jamie Adkins

Other Decks in Programming

Transcript

  1. What are Dynamic Features? • At Install Time ◦ •

    Conditional ◦ • Instant enabled ◦ • On Demand ◦
  2. What are Dynamic Features? • At Install Time ◦ •

    Conditional ◦ • Instant enabled ◦ Download just this feature when the user clicks on a link. • On Demand ◦
  3. Application Class - Before class IccApplication : DaggerApplication() { override

    fun onCreate() { super.onCreate() Timber.plant(CrashlyticsTree()) Fabric.with(this, Crashlytics()) } override fun applicationInjector() : AndroidInjector<out DaggerApplication> { return DaggerAppComponent.builder().create(this) } }
  4. Application Class - Before class IccApplication : DaggerApplication() { override

    fun onCreate() { super.onCreate() Timber.plant(CrashlyticsTree()) Fabric.with(this, Crashlytics()) } override fun applicationInjector() : AndroidInjector<out DaggerApplication> { return DaggerAppComponent.builder().create(this) } }
  5. Application Class - Before class IccApplication : DaggerApplication() { override

    fun onCreate() { super.onCreate() Timber.plant(CrashlyticsTree()) Fabric.with(this, Crashlytics()) } override fun applicationInjector() : AndroidInjector<out DaggerApplication> { return DaggerAppComponent.builder().create(this) } }
  6. Stub Themes <!-- base/src/main/res/values/styles.xml --> <!-- Empty theme in base

    module --> <style name=”QuizTheme” /> <!-- quiz/src/main/res/values/styles.xml --> <!-- Actual implementation in quiz dynamic feature module --> <style name="QuizTheme" parent="Theme.MaterialComponents"> <item name="colorPrimary">@color/cwc_primary</item> <item name="colorAccent">@color/cwc_secondary</item> ...