Slide 1

Slide 1 text

⚡Android Instant Apps⚡ Marcin Koziński

Slide 2

Slide 2 text

– me, right now “What if you didn’t have to install Android apps to use them?”

Slide 3

Slide 3 text

https://pixabay.com/en/staircase-modern-abyss-hole-962784/

Slide 4

Slide 4 text

https://developer.android.com/topic/instant-apps/index.html “Native Android apps that run instantly,
 without the installation”

Slide 5

Slide 5 text

https://developer.android.com/topic/instant-apps/index.html “Native Android apps that run instantly,
 without the installation” “An upgrade to your existing Android app, not a new, separate app. It's the same Android APIs, the same project, and the same source code.”

Slide 6

Slide 6 text

https://developer.android.com/topic/instant-apps/ux-best-practices.html

Slide 7

Slide 7 text

https://developer.android.com/topic/instant-apps/ux-best-practices.html sandbox/runtime .apk .apk .apk or

Slide 8

Slide 8 text

Requirements • Support deep linking and App Links • Slim down your app, hard limit 4MB per download • Implement runtime permissions • If you need log in/sign in - use Smart Lock • If you need payments - use Google Payment API

Slide 9

Slide 9 text

Restrictions • No running in the background • No push notifications • No access to external storage • You can’t see a full list of apps installed on the device • Only available device identifier: Advertising ID • Can’t change device settings such as change the user's wallpaper • You’ll receive only some implicit broadcasts

Slide 10

Slide 10 text

Restrictions • Network traffic from inside the instant app must be encrypted using a TLS protocol like HTTPS

Slide 11

Slide 11 text

Deep links " " """

Slide 12

Slide 12 text

Deep links "// Later in activity onCreate final Uri uri = getIntent().getData(); if (uri "!= null) { uri.getPathSegments(); "// List ["hello", "world"] }

Slide 13

Slide 13 text

App Links " "

Slide 14

Slide 14 text

App Links " "

Slide 15

Slide 15 text

App Links • Upload a special JSON to a “well-known” location on your servers.
 https:///.well-known/assetlinks.json • https://d.android.com/training/app-links/index.html • http://zdominguez.com/2017/01/20/testing-autoverify.html • App links assistant in Android Studio • MCE 2017: Cyril Mottier, Seamless Linking to Your App

Slide 16

Slide 16 text

Default URL …q " "

Slide 17

Slide 17 text

Default URL " …q " "

Slide 18

Slide 18 text

Let me explain you 4MB limit • You: <4MB? NO WAI • Me: YAS WAI $ • APK Analyzer, Proguard, shrink resources/unused resources, .webp, … • Android Instant Apps: Best practices for managing download size • Wojtek Kaliciński: #SmallerAPK, session at Google I/O '17

Slide 19

Slide 19 text

.zip .zip .apk .apk .apk .apk .apk features: base: single feature multi-feature

Slide 20

Slide 20 text

apply plugin: 'com.android.application' apply plugin: 'com.android.library'
 apply plugin: 'com.android.instantapp' apply plugin: 'com.android.feature' a

Slide 21

Slide 21 text

Single-feature instant app .java :app .java .xml .png apply plugin: 'com.android.application' .java

Slide 22

Slide 22 text

Single-feature instant app .java :app .java .xml .png apply plugin: 'com.android.application' .java :base apply plugin: 'com.android.library'

Slide 23

Slide 23 text

Single-feature instant app .java :app .java .xml .png apply plugin: 'com.android.application' .java :base "//apply plugin: 'com.android.library' apply plugin: 'com.android.feature'

Slide 24

Slide 24 text

Single-feature instant app .java :app .java .xml .png apply plugin: 'com.android.application' .java :base "//apply plugin: 'com.android.library' apply plugin: 'com.android.feature' :instantapp apply plugin: 'com.android.instantapp'

Slide 25

Slide 25 text

Single-feature instant app :app apply plugin: 'com.android.application' :base baseFeature true dependencies { "//… application project(‘:app') } :instantapp apply plugin: 'com.android.instantapp'

Slide 26

Slide 26 text

Multi-feature instant app :app :base :instantapp :feature-a :feature-b

Slide 27

Slide 27 text

Tools • Android Studio 3.0, Android Gradle Plugin 3.0 (currently beta). • Instant Apps SDK (downloadable from the SDK Manager in AS). •aimplementation 'com.google.android.instantapps:instantapps:1.0.0' • Mostly all existing libraries, subject to “requirements & restrictions” • Mostly normal workflow: run from AS, attach debugger, etc.
 (Note: need to sign in with a Google account on device/emulator.)

Slide 28

Slide 28 text

https://www.whitehouse.gov/blog/2017/04/27/president-trump-signs- executive-order-promoting-agriculture-and-rural-prosperity

Slide 29

Slide 29 text

Publishing https://medium.com/aubergine-solutions/its-all-about-android-instant-apps-e27b66c04a07

Slide 30

Slide 30 text

Learn more… • https://g.co/instantapps • Fragmented Podcast #090: Make your apps instant with Zarah Dominguez • 3 Google I/O '17 sessions (linked here, here and here) • Android Instant Apps, step-by-step: how Vimeo went about it • From Westinghouse to Android Instant apps, a BuzzFeed Journey • Ask me @marcinkozinski or Mobile Warsaw Slack