What's new in android 2018, a content created by Google, and conducted by Shady Selim, for developers attending DevFest all across Egypt.
It combines all the latest Android for Developers updates
63. What if you lose connectivity?
Use constraints!
64. // 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)
81. HelpFragment.kt
val args : HelpFragmentArgs = HelpFragmentArgs.fromBundle(arguments)
val screenName: String = args.screenName
val category: Int = args.category
91. Android KTX
Part of Jetpack
Concise, readable code.
A suite of libraries
Android KTX, Testing KTX, ...
92. 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(...)
94. val tv: TextView
// Distance from top to first baseline
tv.firstBaselineToTopHeight = distancePx
// Distance from bottom to last baseline
tv.lastBaselineToBottomHeight = distancePx
101. 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+)
102. 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
103. Notifications
People love messages
âŠso we focused on MessagingStyle
â Inline images/stickers
â Participant images
â Smart reply UI
â RemoteInput.setChoices()
And more!