Join David Gassner for an in-depth discussion in this video An overview of Android 6.0 new features, part of Android 6.0 New Features for Developers.
- Android 6.0, codenamed Marshmallow, has many new features both for users and for developers. Here are some demonstrations of some of the new features of this release. Google Now on Tap lets you use Google to search for any text in any app. With an app's activity open, you can simply press and hold the Home button. Google Now on Tap scans the text on your screen and then offers possible searches. This search, for example, is in Google, and I'll be searching for other similar items.
You can also search for movie titles, for example. If somebody were to send me an email with the name of a popular movie and I select Google Now on Tap, I would see a variety of searches related to that movie. As a developer, you don't need to do anything for this feature to work. It's automatic in Marshmallow. But as I'll describe, there are ways of feeding information to Google Now on Tap when the user presses and holds that Home button. The app waterfall is another new feature, and it refers to Marshmallow's new listing of available apps.
In past versions the app list was a multi-page display, and it wasn't easily searchable. Now apps are listed in a single scrollable screen, and there's a search text box at the top that you can use to filter your apps. I'll type H and then, once again, select my app. There are also four slots at the top of the list for the most recently used apps. Users of the previous version of Android might already be seeing this version of the app list. It's part of the Google app launcher and was included in a recent upgrade to Android 5, Lollipop.
Android 6 also has a new user interface for cutting, copying, and pasting text. As before, to trigger this, touch and hold on a word to cut or copy. I'll go into my email, and I'll start replying. Then I'll touch and hold on one word, drag to extend the selection, and then I can copy or select all from this screen or touch the icon to see other features such as web search.
Depending on the context, you can sometimes also trigger a share menu and send selected text to other apps without having to copy and paste. There are also new capabilities for managing memory and for backing up and restoring app data. Again, these are features that are for the end user, and as a developer, they don't always affect what you do. But there are ways of providing information to these features and there are many other new features that are specifically designed for developers.
One of the most important new features is a new permissions model that lets you defer asking for permissions until the user tries to do something that needs that permission. You might need to add some code to your app for this feature, both checking whether particular permissions have been granted and requesting permissions with the new API. Not all permissions are the same. Some are called normal permissions and are granted automatically, while others are called dangerous permissions. Those are the ones that you'll have to add code for if you want to target this new version of Android.
The new Doze feature is mostly automatic and is designed to increase device battery life by putting background services to sleep when the device isn't being used. But developers who use services should know how to test their app when the device is sleeping so you can understand what will work and what will be turned off. Android 6 now supports fingerprint scanners, and the new Nexus phones have the required hardware. You can use this feature to manage your own authentication requirements.
And you can now control which apps handle a specific type of content in a way that wasn't previously possible. For example, if you wanted to share mapping information with another app, in the past a device with both Maps and Google Earth installed would have made the user choose which app they wanted. You can now designate a specific app by registering it in your own apps manifest. There are many other changes and additions, more than I'll be able to cover in detail in this course. The Direct Share API can make data sharing quicker and more intuitive for users.
You can now define Direct Share targets that launch a specific activity in your app when a particular type of data is shared from another app on the device. The Assist API lets you piggyback on the power of Google Now on Tap, so when a user long presses the device's Home button, they're triggering context-sensitive information from your app in addition to the general Google search that happens automatically. Marshmallow lets users adopt external storage such as Micro SD cards and use it as internal storage.
There are now a number of methods you can call to get references to various locations on the external storage device, so you don't have to address absolute filepaths in your app. Android 6 improves its mechanism for receiving input from Bluetooth enabled styluses that are connected to a device. And there are many improvements for working with audio, video, and camera functionality. For complete information about all of these improvements, visit the page at this URL.
Now let's get started with some specific demonstrations of Marshmallow's newest features for developers.
In this short training course, David Gassner shows how to authenticate users using device credentials or the fingerprint scanner, configure apps for backup, test backups to Google servers, and use app links, website associations, and voice interactions. Plus, learn how to control data display in activity layouts with the new data-binding framework.