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
47
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
Navidot - Presentation of a school project using Flutter in 3 months
gdgmontreal
0
8
Getting Started Right: A Guide to Project Structure & Architecture
gdgmontreal
0
9
Flutter @Next’24 - How Google did promoted Flutter
gdgmontreal
0
7
Introduction to Game Development in Flutter with Flame
gdgmontreal
0
18
Leveraging generics to create flexible, type-safe, highly reusable code
gdgmontreal
0
13
Demystifying OWASP Top 10 Mobile Risks
gdgmontreal
0
12
Core concepts of Navigation in Flutter
gdgmontreal
0
20
2024 FlutterMTL January Meetup - Mastering Dart Langchain by Eckarath
gdgmontreal
1
36
2024 FlutterMTL January Meetup - Build Customization by Nicolas Cuillery
gdgmontreal
0
22
Other Decks in Technology
See All in Technology
開発生産性大幅アップ!Postman VS Code拡張機能
nagix
2
370
On Your Data を超えていく!
hirotomotaguchi
2
660
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
120
チームでロジカルシンキングに改めて向き合っている話 〜学習環境と実践⽅法〜
sansantech
PRO
2
2.1k
本当のAWS基礎
toru_kubota
0
500
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
380
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
350
Java EE/Jakarta EEの現状と将来―クラウドネイティブ時代にJava EEは対応できるのか?―
takakiyo
1
140
DevOpsDays History and my DevOps story
kawaguti
PRO
9
2.5k
Terraformあれやこれ/terraform-this-and-that
emiki
8
1.4k
Meta Quest 3 で動く桜マシマシ WebXR アプリを IBM Cloud Code Engine と Babylon.js で作った話
1ftseabass
PRO
0
120
開発生産性向上サービスを作るFindyが自分たちで開発生産性を爆上げした組織づくりの歩み / Findy's path to boosting its own development productivity 2024-04-17
ma3tk
3
630
Featured
See All Featured
Navigating Team Friction
lara
178
13k
The Cult of Friendly URLs
andyhume
74
5.7k
Being A Developer After 40
akosma
57
580k
Making Projects Easy
brettharned
108
5.5k
KATA
mclloyd
15
12k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.5k
The Invisible Customer
myddelton
114
12k
Teambox: Starting and Learning
jrom
128
8.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Producing Creativity
orderedlist
PRO
337
39k
How STYLIGHT went responsive
nonsquared
92
4.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
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!