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

What's new in Android 2018

What's new in Android 2018

This a deck that Google provide to share what is new in Android 2018.

GDG Montreal

November 25, 2018
Tweet

More Decks by GDG Montreal

Other Decks in Technology

Transcript

  1. Source: Partner provided data 5 10 15 20 25 30

    35 40 45 50 55 60 65 70 75 80 85 90 95 100 APK size (MBs) Conversion rate decreases as apps get larger Play Store conversion rate (% of visitors who install) Trendline
  2. xxhdpi arm hdpi arm xhdpi arm mdpi arm ldpi arm

    xxxhdpi arm xxhdpi x86 hdpi x86 xhdpi x86 mdpi x86 ldpi x86 xxxhdpi x86
  3. xxhdpi arm64 hdpi arm64 xhdpi arm64 mdpi arm64 ldpi arm64

    xxxhdpi arm64 xxhdpi arm hdpi arm xhdpi arm mdpi arm ldpi arm xxxhdpi arm xxhdpi x86 hdpi x86 xhdpi x86 mdpi x86 ldpi x86 xxxhdpi x86 xxhdpi x86_64 hdpi x86_64 xhdpi x86_64 mdpi x86_64 ldpi x86_64 xxxhdpi x86_64
  4. xxhdpi arm64 v:14 hdpi arm64 v: 16 xhdpi arm64 v:15

    mdpi arm64 v:17 ldpi arm64 v:18 xxxhdpi arm64 v:13 xxhdpi arm v:20 hdpi arm v:22 xhdpi arm v:21 mdpi arm v:23 ldpi arm v:24 xxxhdpi arm v:19 xxhdpi x86 v: 8 hdpi x86 v:10 xhdpi x86 v:9 mdpi x86 v: 11 ldpi x86 v:12 xxxhdpi x86 v: 7 xxhdpi x86_64 v: 2 hdpi x86_64 v: 4 xhdpi x86_64 v:3 mdpi x86_64 v:5 ldpi x86_64 v: 6 xxxhdpi x86_64 v: 1
  5. Android App Bundle Benefit from a smaller app Stop managing

    multiple APKs Deliver features on-demandBETA
  6. Source: Partner provided data saving 11% saving 23% saving 45%

    saving 22% 28% saving ABA English Airbnb LinkedIn Perigee saving 49% RV AppStudios saving 64% Memrise Pluto. TV
  7. /res/xxxhdpi classes.dex /res/xxhdpi config_xxxhdpi.apk base.apk config_xxxhdpi.apk /res/xhdpi /res/hdpi config_xhdpi.apk config_hdpi.apk

    /res/mhdpi /res/ldpi config_mhdpi.apk config_ldpi.apk /lib/x86 /lib/arm config_x86.apk config_arm.apk /res/values-en /res/values-fr config_en.apk config_fr.apk /res/values-es config_es.apk …
  8. Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled

    from OS lifecycle Room SQLite object mapping LiveData Lifecycle aware observables
  9. Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled

    from OS lifecycle Paging (1.0!) Asynchronous data retrieval Room SQLite object mapping LiveData Lifecycle aware observables
  10. Unlimited Background Services Doze App Standby Limited Broadcasts Release Wakelocks

    Service Limitations App Standby Buckets Background Restrictions
  11. There is still a lot of work to do Sending

    logs Uploading images and videos Syncing data Processing data
  12. // A simple Worker class UploadPhotoWorker : Worker() { override

    fun doWork(): WorkerResult { uploadPhoto() return WorkerResult.SUCCESS } } SUCCESS FAILURE RETRY Runs on a background thread
  13. // Creating a work request and enqueuing it val request:

    WorkRequest = OneTimeWorkRequestBuilder<UploadPhotoWorker>().build() WorkManager.getInstance().enqueue(request) Ω
  14. // Creating a work request with network constraints val constraints

    = Constraints.Builder() .setRequiredNetworkType(NetworkType.CONNECTED) .build() val request = OneTimeWorkRequestBuilder<UploadPhotoWorker>() .setConstraints(constraints) .build() WorkManager.getInstance().enqueue(request)
  15. When to use? Best-Effort Guaranteed Execution Exact Timing Deferrable ThreadPool

    Coroutines ThreadPool Coroutines Foreground Service
  16. Navigation Define navigation graph with visual tool / XML: Make

    a single navigate() call and runtime library handles everything
  17. HelpFragment.kt if (!arguments.containsKey("screenName")) { throw IllegalArgumentException() } val category: Int

    = arguments.getInt("category") val screenName: String = arguments.getString("screenName")
  18. Battery App Standby Buckets usage based access to jobs, alarms,

    network, messaging Background Restriction user can restrict badly-behaved apps
  19. Android KTX Part of Jetpack Concise, readable code. A suite

    of libraries Android KTX, Testing KTX, ...
  20. Background Text Measurement Text measurement is expensive Up to 80

    to 90% of the draw/measure/layout loop Pre-computed text API offloads most of the work to a worker thread PrecomputedText.create(...)
  21. val tv: TextView // Distance from top to first baseline

    tv.firstBaselineToTopHeight = distancePx // Distance from bottom to last baseline tv.lastBaselineToBottomHeight = distancePx NEW
  22. Display Cutouts Simulate notches in developer options (skip the electrical

    tape) WindowInsets#getDisplayCutout() android:windowLayoutInDisplayCutoutMode • mode=”never” • mode=”default” • mode=”shortEdges” + DisplayCutout#getSafeInsets() • mode=”shortEdges” + DisplayCutout#getBounds()
  23. Slices A new approach to remote content • Within an

    app or between apps • Structured data, flexible templates • Interactive, updatable • Backwards-compatible! • (Support Library, KitKat/API 19+)
  24. Actions Deep links into your app • “shortcuts with parameters”

    • “a visible Intent” Define actions in actions.xml Register with App Indexing to show as on-device search results
  25. Notifications People love messages …so we focused on MessagingStyle •

    Inline images/stickers • Participant images • Smart reply UI • RemoteInput.setChoices() And more!
  26. What’s New In Android Android App Bundle https://g.co/androidappbundle Android Jetpack

    https://d.android.com/jetpack https://d.android.com/kotlin https://d.android.com/arch https://d.android.com/arch/navigation https://d.android.com/arch/workmanager Core Platform App Standby Buckets Background Restrictions System UI Display Cutouts Slices & Actions Notifications