英文原文 : First Preview of Android N: Developer APIs & Tools

Dave Burke, VP of Engineering at Google. Translation: Guokai Han.

We’re excited to announce the release of Android N Developer Preview today! This year we did things a little differently, we released a preview earlier… It’s really early. By releasing an “in progress” early build, we had more time to incorporate developer feedback. The early preview also allows us to deliver the final Version of Android N to device manufacturers this summer so they can get the latest version of Android earlier than ever before. We look forward to your feedback when your app is ready for Android N.

Here are some of the apis and new features we’d like to highlight as part of the Android N developer preview released today, with more to come as we continue development:

Many window: since Android N will support a new manifest attribute Android: resizableActivity. If this property is set to true, the activity can be started in split screen mode on phones and tablets. You can also specify a minimum acceptable size for your activity in case the user moves the Activity window below this size. The multi-window lifecycle changes are similar to switching between vertical and horizontal modes: An activity can handle its own configuration changes, or it can tell the system to stop it and rebuild the activity with its new dimensions. In addition, activities can be used to create picture-in-picture mode on devices such as TVS. This is very good for video broadcast applications features, to use this feature please send android: supportsPictureInPicture set to true.

Review images

Callable notifications: The RemoteInput notification API was originally added for Android Wear and is now available for phones and tablets in Android N. Using the RemoteInput API allows users to quickly and easily respond to received message notifications without leaving the notification list. See here for more information.

Packaged notice: in the Android N, you can use the Notification. The Builder. SetGroup () method will come from the same application multiple notifications to a set of packaging, such as message application of multiple independent news. Packaged notifications can be expanded into separate messages by using a two-finger gesture or by clicking the new expand button. See here for more information.

Efficiency: In Marshmallow the system goes into Doze mode when the device is stationary to save battery. In Android N, Doze saves even more power every time the screen is off. If your application has already adapted Doze mode, such as using GCM high-priority messages for urgent notifications, then this does not affect you; If not, here’s how to get started. We are also continuing to invest in Project Svelte, a Project to reduce Android’s memory requirements so that Android can run on a wider range of devices. Android N makes background work much more efficient. If you’re already using JobScheduler to perform background tasks, you’re already on the right track. If you haven’t already, Android N is a good time to do this. To help you, we’re making JobScheduler more powerful, so now you can use JobScheduler to respond to changes like those on content Providers.

Improved Java 8 support: We are very excited to bring Java 8 language features to Android. Using the Jack compiler for Android, you can now use many of the popular Java 8 language features, including Lambda, and forward support for Android Gingerbread. New features help reduce boilerplate code. For example, lambda can be used instead of anonymous inner classes where event listeners are required. Several Java 8 language features, such as default and static methods, Streams, and functional interfaces, are now available in Android N and above. With the Jack compiler, we expect to keep up with the Java language more closely while maintaining forward compatibility.

Started guide

The Android N Developer preview includes the updated SDK and system images for testing on official Android emulators and hardware devices, Mirroring support includes Nexus 6, Nexus 5X, Nexus 6P, Nexus Player, Nexus 9, and Pixel C devices (to help test these features on tablets, developers can get a $150 discount on the Pixel C).

This initial developer preview is intended for developers only, not for everyday use or consumer use. We intend to update the preview system image frequently as part of our developer Preview program. When we get closer to the final version, we will also invite consumers to try it out.

With the new Android Beta program, we’ll also make it easier for you to try Out Android N on your development device. Starting later today, you will be able to update your Android device to Android N Developer Preview and get subsequent updates via OTAs.

Click here for more information on the hands-on Android N preview and let us know what you think. The sooner we receive your feedback, the more suggestions we can incorporate.