LightBlog

mercredi 19 février 2020

Here are the new developer features in the Android 11 Developer Preview

Today, Google announced the first Android 11 Developer Preview in an official blog post. The company has already released system images for any developer interested in installing the new Android OS. We recommend you do install it as soon as possible in order to test your app against the latest behavioral changes and platform features in Android 11. Before you dive into the docs, here’s a summary of all the major new developer-focused features in the first Android 11 Developer Preview.

New Networking/Connectivity Features

5G connectivity is going to be all the rage this year and next: Samsung is making 5G-enabled smartphones widely available with the Galaxy S20 series while Qualcomm continues raising the bar on 5G smartphone connectivity. With Android 11, Google is adding two new APIs to prepare developers for the reality of 5G connectivity. Not only these, but other connectivity-based APIs are also gaining some polish.

Bandwidth Estimator API

Google is updating ConnectivityManager to make it easier to check downstream and upstream bandwidth without needing to poll the network or needing developers to compute their own estimates. If the modem does not support providing this data, the API will make a default estimation based on the existing network connection.

Dynamic Meteredness API

This API allows developers to check whether the user is on an unmetered connection, and if so, offer a higher resolution or quality media that could potentially use much more data. With Android 11, this API has been extended to include cellular networks, so that developers can now identify users whose carriers are offering truly unmetered data services on their 5G network.

Call screening service improvements

Google introduced the concept of “roles” in Android 10. They’re a bit similar to “default apps” in that granting a role to an app allows it to have access to certain APIs. For instance, there’s a call screening role that allows a third-party app to block or identify incoming calls before the user is made aware of them. In Android 11, call screening apps can now get the incoming call’s STIR/SHAKEN verification status as part of the call details. They can then customize a system-provided post-call screen to let users perform actions such as marking a call as spam or adding the caller to contacts. This will help call screening apps do more for the user by streamlining reactions after an unknown caller.

Wi-Fi suggestion API enhancements

The Wi-Fi suggestion API will now allow connectivity management apps greater ability to manage their own networks. For example, connectivity management apps will now be able to force a disconnection by removing a network suggestion, manage Passpoint networks, receive more information about the quality of connected networks, and more.

Passpoint enhancements

Wi-Fi Passpoint, according to the Wi-Fi Alliance, is a solution that streamlines network access to Wi-Fi hotspots by enabling automatic network discovery and selection, simplifying online sign-up, and seamlessly enabling hotspot roaming. Android 11 will allow for enforcement and notification about the expiration date of a Passpoint profile, as well as support Common Name specification in the profile and allow self-signed CAs for Passpoint R1 profiles. And as mentioned above, the Wi-Fi suggestion API will also allow connectivity apps to manage Passpoint networks.

New UI/UX Features

UI support for hole-punch and waterfall displays

Android smartphone OEMs lead innovation in the hardware space, and one of the most notable hardware changes we have seen in recent times is the introduction of display cutouts. The Samsung Galaxy S20 series, for instance, features single centered hole-punch displays. Hole punch displays, or pinhole displays as Google refers to them, are displays that have a camera surrounded by display pixels on its entire edge—almost as if someone used a hole-puncher on the display. Another display innovation is the waterfall display: displays that have a much more pronounced display curve on the side edges, overflowing down to the sides of the device.

galaxy s20

Left: The Samsung Galaxy S20+ with a single centered hole-punch display. Right: Huawei Mate 30 Pro and Vivo Nex 3 5G with curved “waterfall” displays.

Android 11 is now extending support to hole-punch displays and waterfall displays through the display cutout API. If developers want, the API will also allow them to build apps that can use the entire waterfall screen including the edges, with insets to help manage interactions near the edges.

Dedicated conversations section in notifications

A lot of us receive a ton of notifications in a day, but not every notification is equally important. Generally, notifications from messaging apps tend to be more important than other app-originated notifications. To that end, Android 11 is introducing a dedicated conversations section in the notification shade. This will allow users to easily find their ongoing conversations with people in their favorite apps, and help developers create deeper conversational experiences.

Bubbles API

Last year, we had pointed out how the Bubbles API introduced in Android 10 will replace the overlay API in a future Android version. With Android 11, Google is pushing developers of messaging and chat apps to make the transition to Bubbles to keep conversations in view and accessible when a user is multitasking on their phone.

Image insertion into notification replies

Android 11 will now allow apps that support copy/pasting images to let their users insert these images directly into the inline reply in the notification, meaning that users can long-press and have the Paste context menu option available to them when replying to a notification from the notification shade. Google Chrome was already working towards support for copying images directly to Android’s clipboard, and Gboard was preparing to let users paste images directly into social media and messaging apps. Google now mentions that these features will be available on Android 11 Developer Preview 1.

Image and Camera Improvements

HEIF Animated Drawables

The ImageDecoder API will now let developers decode and render image sequence animations that are stored in HEIF (High-Efficiency Image Format) files. This will allow developers to make use of high-quality assets while minimizing the impact on network data and APK size. HEIF image sequences offer drastic file-size reductions when compared to GIFs, so HEIF is in a good position to be a better alternative in mobile-based use cases. Developers will be able to display HEIF image sequences in their apps by calling decodeDrawable with a HEIF source. If the source contains a sequence of images, an AnimatedImageDrawable is returned.

Native image decoder

Android 11 is introducing new NDK APIs that will let apps decode and encode images from native code for graphics or post-processing while retaining a smaller APK size as there is no need to bundle an external library. The native decoder also takes advantage of Android’s process for ongoing platform security updates.

Muting during camera capture

New APIs allow apps to mute vibration from ringtones, alarms, and notifications when a camera capture session is active, as these vibrations can tend to introduce shake into the recording, which can be amplified even further if the user is zooming in.

Bokeh modes

Apps can now use metadata tags to enable bokeh modes on camera capture requests on devices that support it.

Low-latency video decoding

Apps can now use new APIs to check and configure low-latency playback for a specific codec.

Low latency video is critical for real-time video streaming apps and services like Stadia. Video codecs that support low latency playback return the first frame of the stream as quickly as possible after decoding begins.

HDMI low-latency mode

New APIs now allow apps to check for and request auto low latency mode (also commonly known as game mode) on external displays and TVs. In this mode, the display or TV disables graphics post-processing in order to minimize latency.

Miscellaneous New and Updated APIs

Neural Networks API 1.3

Neural Networks API (NNAPI) is designed to run computationally intensive operations for machine learning on Android devices. With Android 11, Google is expanding the operations and controls available to developers under this API:

  • Quality of Service APIs support priority and timeout for model execution.
  • Memory Domain APIs reduce memory copying and transformation for consecutive model execution.
  • Expanded quantization support through signed integer asymmetric quantization wherein signed integers are used in place of float numbers to enable smaller models and faster inference.

App Compatibility

New platform updates can bring potential app compatibility issues for app developers, so Google is also doing work on prioritizing app compatibility. With Android 11, Google is adding in new processes, developer tools, and release milestones that aim to minimize the impact of platform updates and thus, minimize compatibility issues.

  • Minimizing the impact of behavior changes: Google has made a conscious effort to minimize behavioral changes that can affect apps. All such changes have been closely reviewed alongside their impact, and an attempt has been made to make as many of them opt-in as possible until developers set their app’s targetSdkVersion to Android 11. It is not yet possible to publish applications targeting API level 30 yet, but Google will enable the ability to do so in a future Android 11 Developer Preview.
  • Easier testing and debugging: Inline with what we had reported last month, the first Android 11 Developer Preview comes with an “App Compatibility” Developer Option to help devs test new platform changes. A lot of breaking changes introduced in the Android 11 Developer Preview have been made toggleable—allowing devs to force-enable or disable the changes individually from Developer Options or through ADB. This should help alleviate pains when testing for app compatibility as developers would not need to recompile their app for basic testing or change targetSdkVersion.

Android 11 Developer Preview App Compatibility Developer Option

  • Updated greylists: Google has updated the list of restricted non-SDK interfaces. The Android 11 Developer Preview release has also removed the meta-reflection workaround that some developers were using.
  • Dynamic resource loader: Developers had asked for a public API to load resources and assets dynamically at runtime, and in Android 11, Google has added in a Resource Loader framework.
  • New platform stability milestone: Preparing apps for early compatibility was a challenge for developers during the Developer Preview/Beta phase as there were no clear dates for final changes to the platform for that version. Thus, with Android 11, Google is adding in a new release milestone called “Platform Stability”, which Google expects to reach in early June. This milestone release will not only include the final SDK and NDK APIs, but it will also include final internal APIs and other system behaviors that may affect apps. More information on the release timeline is available on Google’s developer site.

If you want to test out the new Android 11 Developer Preview, you can flash a prebuilt system image onto a Pixel 2, Pixel 2 XL, Pixel 3, Pixel 3 XL, Pixel 3a, Pixel 3a XL, Pixel 4, or Pixel 4 XL. Alternatively, you can flash a prebuilt, Google-signed Generic System Image (GSI) onto any Project Treble-supported device with an unlocked bootloader. If you don’t have one of the supported Pixel phones or a device that supports Project Treble with an unlocked bootloader, then you can download the latest system image for the emulator in Android Studio. The Android Emulator running the Android 11 system image has experimental support to run ARM 32 and 64-bit binary code on 64-bit x86 system images.

In addition to setting up the Android Emulator, you can also download the Android 11 Developer Preview SDK and NDK inside Android Studio. Google recommends you update Android Studio to the latest Canary release to take advantage of the IDE’s latest features. Once you’re all set up, you can explore the latest platform features and behavioral changes in the Android 11 Developer Preview by checking out the API overview, API reference, and API diff report. If you have any feedback to offer, you can let Google know through any of their official channels. If you find a bug in the Developer Preview, you can file a report on the Google Issue Tracker. Lastly, be sure to follow our news tag for the latest updates on Android 11—there are many platform features and behavioral changes that we find that Google just doesn’t document!

Android 11 News on XDA

The post Here are the new developer features in the Android 11 Developer Preview appeared first on xda-developers.



from xda-developers https://ift.tt/2SGjOef
via IFTTT

Aucun commentaire:

Enregistrer un commentaire