We just released the Beta version of Android Q two months ago, we’ve been listening to your feedback and comments for the past two months, and we just launched Beta 3 on Google I/O this year. We strongly encourage you to join the Beta program and test your apps on it. We welcome your comments, suggestions, and requests for Android Q.

Android Q theme

Those are the three themes of this year’s Android Q update. Today I’m going to talk about behavior changes in privacy, performance improvements, and making it easier to update users’ systems with Project Mainline.

The system UI

The change of system UI is the most intuitive for users. In the modification of system UI, our principle is to make developers more comfortable in development through improvement. We want users to be able to easily invoke the features they want to use most, even if the application is not open. On Android Q, we’ve made a lot of improvements to sharing, notification, and multitasking.

share

We’ve made major changes to the sharing interface

One is to reference new apis to improve performance;

Second, it has improved the presentation of the interface, making it clear where content can be shared.

The sharing page is now divided into three areas. The first is the new content preview area, which contains links, ICONS and titles for sharing content, as well as a copy button. This is where developers can add metadata for rich content previews.

Above is the code implementation of the rich content preview.

The second is the sharing shortcut, which allows users to share more quickly within the app.

This block can display up to 8 shared targets, which can be the most frequently interacting contacts or groups in communication tools, or the most frequently used working directory, etc. Because Sharing within the application will be more efficient than opening the application and selecting the Sharing method, the shortcut area of Sharing will be displayed at the top of the Sharing application, and the priority of Sharing Cuts will be higher than the Chooser Target Service provided in the previous version. We also provide backward compatibility through Android ACTS:

Creating ways to share within shortcuts is also simple.

Adding a full field of the Person class information in the Sharing Shortcu increases the priority of Sharing presentations and presentations in notifications.

The third share target app area displays all shareable apps.

notice

Over the past few releases, we’ve been working hard to help users comb through their notifications bar, and in past releases we’ve also introduced shortcuts to help users turn off notifications.

To help users reduce interruptions and pay attention to important notifications, we’ve optimized priorities for Android Q.

The top half of the figure is a high-priority notification and the bottom half is a low-priority notification. The system respects the priorities set by the user, but preempts them to avoid abuse of higher-priority apis. The system gives higher priority to notifications, call messages, events, and so on about “people”. The priority is ultimately determined by the user, who can easily change the priority of the application in Q.

It is highly recommended that you add this option to your app’s notifications.

In Android Q, the system automatically generates auto-reply prompts for notifications in the Messaging class, including text content, URL Links, and Deep Links in the app (see figure above). For privacy reasons, this is done on the device, not in the cloud.

If you want to be on the basis of the system prompt for some custom, let’s say you want to allow users to click on the reply and editing, or do you want to join some machine learning model to speculate that the user can add how to reply, so if this is the case, we have some custom Suggestions, here are some examples of the code.

The first is how to create new notifications, which will help the application work better with the system when notiform-free mode is turned on. SetAllowSysemGeneratedContenxtualActions on Android Q is open and set to True by default.

Here is an example of how machine learning models can be added to predict user input. We use getSmartReply in Firebasenatura Language to get the instance and call the Suggest method. There is an asynchronous operation, and Firebase will assist in the cloud and return the possible response values, and then add those response values to the choices that the notification might appear in.

multitasking

In Ndroid Q, we introduce Bubbles, a new function that supports multi-task based on System Notification and replaces System Alert Window, which has been abused before. System Alert Window was not designed as a user oriented Feature. Some developers have made some cool features with System Alert Window. In Q, we will restrict the use of this interface. Compared with the picture-in-picture function previously used for video playing scenes, Bubbles appears to deal with scenes requiring more user interaction in multi-task mode. Bubbles is turned on by default in the preview version of Q, but in the final version it will become a Developer Only option and will need to be turned on manually in the Developer options.

In the folded state, Bubbles will be a circular icon with a circular area showing newly received messages. When the user clicks, it expands, creating a complete interface. There are three steps for developers to build Bubbles: first build an Activity that displays the Bubbles, then build the Bubbles’ Metadata and add it to the Notification, and finally send the notification.

Here is the code to create Bubbles.

You first need to set the Activitity property in the app’s Mainfest file. AllowEmbedded, documentLaunchMode and resizeableActivity are three mandatory attributes, otherwise the Notification will not be displayed in the form of Bubbles.

Set the Activity’s Pending Intent first, and then set its icon.

Once the Metadata for Bubble is created, all you need is that line of highlighted code to associate it with the Notification, using the Interface of the Notification Manager to expose Bubble.

If your Notification does not belong to these three scenarios, it will not be displayed as Bubbles. If your app is a real time messaging app, you need to use Message Style inline reply and associate it with Notification. Voice applications use Category Calls, annotate the Person field, and have foreground services.

Kotlin

Over the past two years, more and more Android developers have been using Kotlin.

The Camera360 team shared their new use of Kotlin with us.

Google is now implementing Kotlin-First, and not only does Kotlin come First for first-party applications, but the Jetpack library now supports Coroutine. We will continue to support Java and C development on Android.

To help developers get started with Kotlin faster, we’ve partnered with JetBrains to promote a global community initiative to learn Kotlin. Those interested in studying Kotlin can contact their local GDG.

privacy

Jetpack

TLS 1.3 is enabled by default

Compared to TLS 1.2, the biggest optimization in 1.3 is the speed of establishing secure links faster.

Device ID access Settings

Note that the UUID is not saved as the application is reinstalled or the user clears space.

Settings & Switches

Listen to audio output from other applications

Use this API to allow other applications to listen to the application’s audio output.

It can be used only with the user’s permission.

BiometricPrompt

Including user fingerprint, face recognition, iris recognition and other biometric characteristics. Q has some optimizations based on the API.

Before calling use BiometricManager. CanAuthenticate biological recognition to determine whether can be login.

It is recommended to add alternative mechanisms (passwords, patterns, PINS, etc.) along with biometrics

Android Studio 3.5 (Beta)

List some of the improvements that have been made so far.

Screen emulators for foldable phones are provided, currently 7.3 “and 8” emulators can be created.

Changed the Instant Run feature that developers had complained about for so long, rewriting it and changing it to Apply Changes.

Allows setting heap size in Android Studio for better performance during development.

That’s all for Android Updates, thank you!

Android Q Labs live features page

Android Q Labs opening speech

Android Q modernizes your application

Restrictions on background Activity startup

Android Q partitioned storage

Android Q gesture navigation

Jetpack update

Android Q adaption for foldable devices

Introduction to common system images

Google Play Store policy

Android Q location permission changed

Android Q has a dark theme

Android Q Labs concludes the presentation