page.title=Samples page.image=images/cards/card-samples_16-9_2x.png @jd:body

The following code samples are provided for the M Developer Preview. You can download them in the Android SDK Manager under the SDK Samples component for the M Developer Preview.

Note: These downloadable projects are designed for use with Gradle and Android Studio.

Runtime Permissions

Android M changes the way system permissions work. Users are asked to approve permission requests at runtime instead of during installation. This sample shows how to request these permissions.

Get it on GitHub

Confirm Device Credentials

This sample demonstrates how to use device credentials as an authentication method in your app.

Get it on GitHub

Fingerprint Dialog

This sample demonstrates how to recognize registered fingerprints to authenticate the user in your app.

Get it on GitHub

Automatic Backup

Android M introduces automatic backup for app settings. This sample demonstrates how to add filtering rules to an app in order to manage settings backup.

Get it on GitHub

Voice Camera

This sample demonstrates how to implement the "OK Google, take a selfie" voice command and confirm the user intent with the VoiceInteraction API.

Get it on GitHub

Camera 2 Raw

Demonstrates how to use the Camera2 API to capture RAW camera buffers and save them as DNG files.

Get it on GitHub

Active Notification

This sample demonstrates how the NotificationManager can tell you how many notifications your app is currently showing.

Get it on GitHub

Voice Synthesizer

This sample demonstrates how to use the NativeAudio APIs to demonstrate low-latency audio processing.

Get it on GitHub