​Android N: What developers need to know about Google's latest preview

Attention, Android programmers: Your latest version of Android is ready to start working on.
Written by Steven Vaughan-Nichols, Senior Contributing Editor

Android N is here and ready for your programming expertise to make the next generation of Android apps. Don't plan on releasing your new programs anytime too soon though.

Android N Devices

The latest version of Android is now developer ready.


According to Dave Burke, Google's VP of Android Engineering, "We're doing something a little different this year by releasing the preview early... really early. By releasing a "work in progress" build earlier in development, we have more time to incorporate developer feedback. Also, the earlier preview allows us to hand off the final N release to device makers this summer, so they can get their hands on the latest version of Android earlier than ever."

Although Burke doesn't mention it, another reason for this is that Google has moved from using Apache Harmony for its Java foundation to Oracle's OpenJDK. The good news is that programmers will be able to use Java 8 features. The bad news is you can count on their being some significant changes in how your programs will work on the new Java infrastructure.

Android N code samples: First peek at downloadable projects

On the more purely positive side, Android N will also come with numerous new features. These include:

Multi-window: A new manifest attribute called android:resizableActivity is available for apps targeting N and beyond. If this attribute is set to true, your activity can be launched in split-screen modes on phones and tablets. You will also be able to use this on other Android devices such as smart TVs for picture-in-picture mode.

Call-screening and number blocking: It took Google long enough, but in Android N finally comes with built-in call-screening and number blocking application programming interfaces (API)s. First, N enables the default phone app to screen incoming calls. The phone app does this by implementing the new CallScreeningService, which allows the phone app to perform a number of actions based on an incoming call's Call.Details, such as:

  • Reject the incoming call
  • Do not allow the call to the call log
  • Do not show the user a notification for the call

As for blocking, Google is providing a framework API. This lets service providers maintain a blocked-number list. The default SMS app, the default phone app, and provider apps can read from and write to the blocked-number list. The list is not accessible to other apps.

By providing a consistent way for apps to support number-blocking, Android N users and phone companies can enable the following functions:

  • Numbers blocked on calls are also blocked on texts
  • Blocked numbers can persist across resets and devices through the Backup & Restore feature
  • Multiple apps can use the same blocked numbers list

Additionally, carrier app integration through Android means that carriers can read the blocked numbers list on the device and perform service-side blocking for the user in order to stop unwanted calls and texts from reaching the user through any medium, such as a VOIP endpoint or forwarding phone

Data Saver: This new system service helps reduce 3G/4G data use by apps, whether roaming, near the end of the billing cycle, or on a small prepaid data pack. Data Saver gives users control over how apps use cellular data and lets developers provide more efficient service when Data Saver is on.

Direct reply notifications: The RemoteInput notification API, which was originally added for Android Wear, now works in N for phones and tablets. This RemoteInput API will enable users to reply to incoming message notifications quickly and conveniently, without manually starting a new application.

Improved Battery Efficiency: Doze in Android Marshmallow automatically saved battery life when a device was stationary and not being used. Starting in Android N, Doze will also save battery whenever the screen turns off. If you've already adapted your app for Doze -- e.g. by using the Google Cloud Messaging (GCM) high priority message for urgent notifications -- then you're set.

Improved Memory Efficiency: Google is seeking to reduce Android's memory requirements so it can work on a broader range of devices. Google has been trying to do this since Project Svelte was introduced in Android 4.4, KitKat. The first improvement in Android N is in how JobScheduler handles background tasks.

Java 8 language support: With Android's new Jack compiler, developers will be able to use popular Java 8 language features, such as lambdas and more. This won't be just for Android N. You'll be able to use add these improvements to programs that will be able to run on Android versions as far back as Gingerbread. Some Java 8 language features, of course -- such as default and static methods, streams, and functional interfaces -- will only be available on N and above. With Jack, Google is try to track the Java language more closely while maintaining backward compatibility.

Notification enhancements: Developers will now be able to bundle notifications together. In addition, for real-time communication apps, the Android system supports inline replies so that users can quickly respond to an SMS or text message directly within the notification interface.

The Android N Developer Preview edition is now available for the Nexus 6P, Nexus 5X, Nexus 6, Pixel C Nexus 9, Nexus Player, and the General Mobile 4G, an Android One phone. The Pixel C tablet price for developers has also been reduced by $150 to $349, As expected, the 2013 Nexus 7 tablet, will not be getting Android N.

Are you ready? Google is. Start your Android N projects today.

Related Stories:

Editorial standards