Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What's new in Android 2018
Search
GDG Montreal
November 25, 2018
Technology
0
49
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
Share
More Decks by GDG Montreal
See All by GDG Montreal
Advanced Pregnancy Risk Assessment Using AI Model Chain by Kiruthika Subramani
gdgmontreal
0
15
Al and Security: A double edge sword? by Stacy Véronneau and Yan Bellerose
gdgmontreal
0
28
Scaling AI on a Budget: A Startup's GPU Optimization Journey by Shannon Lal
gdgmontreal
0
19
Build Your Own Secured AI Platform with Google Cloud Vertex AI by unleashing the Power of Multi-LLM by Eckarath Khounsombath
gdgmontreal
0
38
FlutterMTL_-_Flutter_Next_24.pdf
gdgmontreal
0
19
Developing Flutter Applications in Dev Container Environments - Ali Yazdi
gdgmontreal
0
78
Building an ML powered Android Livestreaming App by Etienne Caron
gdgmontreal
1
42
Boosting Your Mobile App: Small Details, Big Impact by Mathieu Fillion
gdgmontreal
0
17
The Hitchhiker's Guide to MLOps by David Cardozo
gdgmontreal
0
10
Other Decks in Technology
See All in Technology
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
2
1.8k
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.6k
Moved to https://speakerdeck.com/toshihue/presales-engineer-career-bridging-tech-biz-ja
toshihue
2
670
OpenID Connect for Identity Assurance の概要と翻訳版のご紹介 / 20250219-BizDay17-OIDC4IDA-Intro
oidfj
0
160
ユーザーストーリーマッピングから始めるアジャイルチームと並走するQA / Starting QA with User Story Mapping
katawara
0
170
一度 Expo の採用を断念したけど、 再度 Expo の導入を検討している話
ichiki1023
1
160
プロセス改善による品質向上事例
tomasagi
2
2.2k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
880
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
1
180
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.3k
Googleマップ/Earthが一般化した 地図タイルのイマ
mapconcierge4agu
1
200
サーバーレスアーキテクチャと生成AIの融合 / Serverless Meets Generative AI
_kensh
12
3.1k
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Producing Creativity
orderedlist
PRO
343
39k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Typedesign – Prime Four
hannesfritz
40
2.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
YesSQL, Process and Tooling at Scale
rocio
171
14k
A Modern Web Designer's Workflow
chriscoyier
693
190k
For a Future-Friendly Web
brad_frost
176
9.5k
A better future with KSS
kneath
238
17k
Transcript
What’s new in Android @L_de_V Laurence de Villers
What’s New In Android PI A s
Android App Bundle
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
xxhdpi hdpi xhdpi mdpi ldpi xxxhdpi
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 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
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
Android App Bundle Benefit from a smaller app Stop managing
multiple APKs Deliver features on-demandBETA
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
Optimized APK for each device Upload an Android App Bundle
Dynamic Delivery
/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 …
App Bundle APK
Android App Bundle Start today at g.co/androidappbundle
Android Jetpack Accelerate App Development
None
95% supported devices
Refactor android.support.v4.* android.support.v7.* // etc. androidx.*
Jetpack Architecture
Jetpack Architecture Lifecycle Lifecycle Aware Components
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle Room SQLite object mapping
Jetpack Architecture Lifecycle Lifecycle Aware Components ViewModel View data decoupled
from OS lifecycle Room SQLite object mapping LiveData Lifecycle aware observables
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
Jetpack Architecture WorkManager Job scheduling Navigation Backstack and app flows
PREVIEW
View Models Simplifying Android development
What is the hardest part of Android Development?
None
ViewModel onCleared()
ViewModel + LiveData onCleared() observe LiveData
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData observe
ViewModel + LiveData onCleared() LiveData
Room A better way to do databases
2016: How do you do Databases on Android?
Database SQLite App Logic Content Provider
Database Uri App Logic Content Provider SQLite
Database Content Values Uri App Logic Content Provider SQLite
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe Not type-safe
App Logic Content Provider Database Content Values Uri SQLite Not
type-safe Not type-safe
Room Database App Logic Content Provider Content Values Uri Not
type-safe Not type-safe SQLite
Room DAO SQLite
Room SQL DAO View Model SQLite Type-safe
Room SQL Entities DAO View Model Type-safe Type-safe SQLite
WorkManager Backwards compatible background work PREVIEW
Battery Optimizations Optimize background tasks to stay charged longer
Unlimited Background Services Doze App Standby Limited Broadcasts Release Wakelocks
Service Limitations App Standby Buckets Background Restrictions
There is still a lot of work to do Sending
logs Uploading images and videos Syncing data Processing data
Basic Work: upload a photo upload
// A simple Worker class UploadPhotoWorker : Worker() { override
fun doWork(): WorkerResult { uploadPhoto() return WorkerResult.SUCCESS } } SUCCESS FAILURE RETRY Runs on a background thread
// Creating a work request and enqueuing it val request:
WorkRequest = OneTimeWorkRequestBuilder<UploadPhotoWorker>().build() WorkManager.getInstance().enqueue(request) Ω
What if you lose connectivity? Use constraints!
// 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)
Show Progress upload
Chain Work compress upload
Parallel Work upload
Complex Flows filter filter filter compress upload
When to use? Best-Effort Exact Timing ThreadPool Coroutines ThreadPool Coroutines
When to use? Best-Effort Guaranteed Execution Exact Timing Deferrable ThreadPool
Coroutines ThreadPool Coroutines Foreground Service
WorkManager Respects users battery Works with OS Backwards compatible (API14)
Navigation How to get around your app PREVIEW
Challenges for navigation Fragment Transactions Deep Links Passing Arguments Up
and Back Errorprone Boilerplate Testing
Home Category Item https://... Need to be created and added
to back stack on deep link
Navigation Graph A navigation graph is a blueprint of screens
and the actions that link them.
Navigation Define navigation graph with visual tool / XML: Make
a single navigate() call and runtime library handles everything
None
Safe Args Type-safe arguments when launching a Fragment
HelpFragment.kt if (!arguments.containsKey("screenName")) { throw IllegalArgumentException() } val category: Int
= arguments.getInt("category") val screenName: String = arguments.getString("screenName")
HomeFragment.kt findViewById<Button>(R.id.help_button).setOnClickListener { v -> val helpDirections = HomeFragmentDirections.help("Home") helpDirections.category
= 1703 v.findNavController().navigate(helpDirections) }
HelpFragment.kt val args : HelpFragmentArgs = HelpFragmentArgs.fromBundle(arguments) val screenName: String
= args.screenName val category: Int = args.category
Navigation IDE tooling for app navigation Manage deeplinks Safe argument
passing
Jetpack Architecture Start today at d.android.com/arch
Integration Tests e2e Tests Unit Tests Android Test Part of
Jetpack
@RunWith(AndroidJUnit4::class) class SimpleUnifiedTest { @Test fun viewIsVisible() { assertEquals(view.visibility, View.VISIBLE)
} } Failed: Expected 0 but was 16 F
@RunWith(AndroidJUnit4::class) class SimpleUnifiedTest { @Test fun viewIsVisible() { assertThat(view).isVisible() }
} Failed: View was not visible F NEW
Core Platform changes in Android Pie
Battery App Standby Buckets usage based access to jobs, alarms,
network, messaging Background Restriction user can restrict badly-behaved apps
Background Inputs & Privacy
Kotlin Performance & Compiler ART, D8, R8 Nullability support library
and libcore
Android KTX Part of Jetpack Concise, readable code. A suite
of libraries Android KTX, Testing KTX, ...
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(...)
Baseline distance
val tv: TextView // Distance from top to first baseline
tv.firstBaselineToTopHeight = distancePx // Distance from bottom to last baseline tv.lastBaselineToBottomHeight = distancePx NEW
Security Unified BiometricDialog @deprecated FingerprintManager Stronger protection for private keys
StrongBox backend Build.SERIAL doesn’t work anymore
System UI Integrating fully with Android
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()
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+)
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
Notifications People love messages …so we focused on MessagingStyle •
Inline images/stickers • Participant images • Smart reply UI • RemoteInput.setChoices() And more!
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
Thank You!