4. Latest Android Q Updates
● Bubbles
● Dark Theme Support
● Sharing improvements
● Notifications
● Gesture Navigation and more.
4
5. Bubbles
Easy multi tasking
● Bubbles are built into the Notification system.
● They float on top of different app content and
follow the user wherever they’re going.
● Bubbles can be expanded to reveal app
functionality and information, and might be
collapsed when not getting used.
E.g. in facebook messenger app.
Sample: https://github.com/googlesamples/android-
Bubbles
For more info:
https://developer.android.com/preview/features/bubbles
Place your screenshot
here
5
6. Dark Theme
Those eyes won’t hurt anymore
● Can reduce power usage by a significant amount.
● Improves visibility for users with low vision and those who
are sensitive to bright light.
● Strongly recommended that apps support dark theme.
● Force Dark feature automatically convert app to the dark
theme (make ‘forceDarkAllowed’ to true).
How to use?
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
OR
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
For more info :
https://developer.android.com/preview/features/darktheme
6
7. Sharing
Improvements
Updated with a new design & APIs
● The Direct Sharing API has been replaced with new
sharing shortcut APIs
● Greatly improved performance.
● Simplified & enhanced UI.
● More Developer customization options.
Sample: https://github.com/googlesamples/android-
SharingShortcuts
For more information:
https://developer.android.com/preview/features/sharing
Place your screenshot
here
7
8. Notification
Gentle & Priority, Notification Actions
● Helps organize valuable & important
notifications.
● Initially configured by developers, but can be
adjusted by users & system.
● Directly access related deeplinks.
● Quick reply with suggested responses.
● Can Generate smart replies with Firebase MLKit.
Place your screenshot
here
8
9. Gesture Navigation
● Only 2 navigation methods will be supported in the
Android platform from Q:
○ 3 buttons
○ Model moving forward.
● Making your app nav-ready:-
○ Make Your UI edge-to-edge.
○ Leverage insets for better UI.
○ Override system gestures.
● App can face conflicts with any horizontally-draggable
content (Sliders, Seekbars etc).
● Common scenarios where app can face problem with
gestures: Scrolling Views, Navigation Drawers, Bottom
Sheets, Landscape mode, Carousels (ViewPager etc).
● New API available in Q to opt out at least the back
gesture.
Place your screenshot
here
9
10. Accessibility
● One liner for accessibility actions
ViewCompat.addAccessibilityAction(...)
● Vary duration of transient UI
AccessibilityManager.getRecommendedTimeout
Millis (default:Int, flags: Int)
10
11. Text
Improve Text Performance
● Hyphenation: Hyphenation is OFF by default in Android Q & AppCompat V1.1.0. To re-
enable hyphenation:
<TextView android: hyphenationFrequency=”normal”/>
● PreComputedText:
○ Use PreComputedText with Recyclerview prefetch.
○ For more info: https://medium.com/google-developers/recyclerview-prefetch-
c2f269075710
https://medium.com/androiddevelopers/prefetch-text-layout-in-recyclerview-
4acf9103f438
Custom Fonts
● Use CustomFallbackBuilder to support multiple fonts
E.g. We want an image in between text, text having custom font (lato).
● Max 64 font families while building Typeface using CustomFallbackBuilder.
● Conceptually different font families can not be put in same Font family object.
11
12. Text
Some more..
Styling Text
● Style, Theme, TextAppearance, View Attribute, Span.
System Fonts
● 270+ pre-installed fonts.
● Find fonts used by system: FontMatcher API (NDK).
● Find installed fonts: FontEnumeration API.
Editable Text
● Now Error message of Edittext will not hide behind the keyboard.
● If you want the keyboard to learn about your password then use
android:inputType=”textVisiblePassword”
● If you don't want the keyboard to learn about your password then use
android:inputType=”textPassword”
● Use IME flags to configure soft keyboard.
12
for(font in SystemFonts.getAvailableFonts()){
//choose your font here.
}
13. Magnifier
● Android magnifier widget. Can be used by any view which is
attached to a window.
● The magnifier is already integrated with platform widgets
such as TextView, EditText, or WebView.
● It provides consistent text manipulation across applications.
● The widget comes with a simple API and can be used to
magnify anyView depending on your application’s context.
View view = findViewById(R.id.view);
Magnifier magnifier = new Magnifier(view);
magnifier.show(view.getWidth() / 2, view.getHeight() / 2);
Place your screenshot
here
13
14. Runtime Permissions
For all the apps running on Android Q
● Prevention of silent access to reading screen content
READ_FRAME_BUFFER, CAPTURE_VIDEO_OUTPUT,
CAPTURE_SCREEN_VIDEO_OUTPUT
● Instead use MediaProjection API with user’s consent
● Opportunity for the user to revoke already granted
permission when user updates to Q for the first time
● New permission ACTIVITY_RECOGNITION added to
track walking, biking or cycling activities of the user.
● Permission groups are removed from UI
Place your screenshot
here
14
15. Security
● Immutable device identifiers will no longer be
available via READ_PHONE_STATE e.g.
Build, IMEI, ESN, SIM etc.
● Mac address randomization.
● App launching & notifications.
● Declare service type in Manifest for services
15
<service
android:foregroundServiceType=”location”/>
16. Kotlin
● New Apis in Q have nullability annotations.
● Nullability enforced as an errors instead of warnings with Q.
● Incremental annotation processing with kapt in 1.3.30
● Coroutines support for Workmanager, Room, LifeCycle, LiveData, ViewModel.
● Jetpack Compose.
● Kotlin plugin part for Android Studio.
● Lint support for kotlin added
16
18. CameraX
Jetpack camera support library
● Camera development is hard because of OS flavors and the Camera API complexity etc.
● Issues tackled in previous camera API:
○ Front/back camera switch crashes.
○ Optimized camera closures etc.
● Backwards compatibility to L (90% devices).
● Easy to use and Consistent behavior across all android devices.
● CameraX benefits:
○ Reduced device specific testing.
○ 75% reduction in lines of code.
○ Smaller apk size etc.
● CameraX is lifecycle aware Easy to use.so you don’t need to start & stop cameraX.
● CameraX hides all the internal functionality from you & maintain it by own.
18
19. Jetpack Navigation
Jetpack library to manage in-app UI flows
● Now can navigate by URI (<deeplink>).
● ViewModel scoped to navigation graphs.
● Can use dialog destinations.
● CodeLabs sample:
https://codelabs.developers.google.com/codelabs/android-
navigation/#0
● Safe Args (Gradle plugin):
Escorting your arguments safely to their destination
apply plugin: “androidx.navigation.safeargs” (for java)
apply plugin: “androidx.navigation.safeargs.kotlin” (for kotlin)
19
20. Jetpack Compose
Next generation UI toolkit
● Reactive
● A kotlin compiler plugin.
● Fully compatible with your existing app/code.
@Composable
fun Greeting(name : String) {
Text(“Hello $name”)
}
● For More info: https://developer.android.com/jetpack/compose
20
21. ViewPager 2
● Like viewPager, but better
● Based on recyclerview
● RTL mode support
● Allows vertical paging.
● Improved dataset change notifications.
dependencies {
implementation 'androidx.viewpager2:viewpager2:1.0.0-alpha04'
}
● offscreenPageLimit: allows for a tight control of the number of page
Views / Fragments kept in the view hierarchy.
21
22. ViewBindings
Coming soon in Android Studio 3.6
● Compatible with Data Binding.
● Full Studio integration.
● 100% compile time safety
● Binding classes built by Gradle Plugin.
val binding = ProfileBinding.inflate(layoutInflater)
setContentView(binding.root)
22
23. SavedState for ViewModel
ViewModel + SavedState
● ViewModel and SavedState are used for different purposes & not same.
● ViewModel works as a cache for heavy objects.
● SavedState used for small data.
class UserViewModel (val handle : SavedStateHandle) : ViewModel(){}
● Syntax for ViewModel initialization:
val viewModel : UserViewModel by ViewModels()
23
24. WorkManager
Background processing library
● Persistence
● Backwards compatibility (API 14)
● On-demand initialization
● Robolectric support available now
● Create test workers using TestWorkBuilder & TestListenableBuilder.
24
25. Room
SQL object mapping library
● Coroutines support.
● You can have suspend method for getting data, insert data etc.
@Query(“select * from Song where songId=songId”)
suspend fun getSong (songId : String) : Song
@Insert
suspend fun insertSong(song : Song)
● Full Text Search (@ Fts4 annotation)
● Database Views
● Expanded Rx support
@Insert
fun addSong(song : Song) : Completable
25
27. AI Tools
● MLKit
● Google Cloud
● TensorFlow (open source)
● For more info look here:
https://firebase.google.com/docs/ml-kit
https://cloud.google.com/solutions/mobile/
https://www.tensorflow.org/lite/guide/android
27
28. MLKit
● Existing Features
○ Vision: Landmark detection, Image labeling, Barcode Scanning,
Face detection.
○ Natural Language: Language identification, Smart Reply.
○ Custom: Model Serving.
● New features:
○ On-device translation: fast and dynamic translation for 59
languages.
○ Object detection and tracking.
28
33. RenderNode
● Efficient rendering (used by views internally)
● Contains:
○ Display list
○ Display properties
● Can be hierarchical (RenderNode can contain another RenderNode).
● Cast shadows without a view.
if (canvas.isHardwareAccelerated()) {
canvas.drawRenderNode(myRenderNode);
}
33