page.title=Set Up the Preview SDK page.image=images/cards/card-set-up_16-9_2x.png @jd:body
The M Developer Preview SDK is available from the Android SDK Manager. This document assumes that you are familiar with Android app development, such as using the Android SDK Manager and creating projects. If you are new to Android, see Building Your First App training lesson first.
The Developer Preview is best used with Android Studio 1.3, which is in preview status. It is highly recommended that you install the preview version of Android Studio 1.3 to work with the Preview SDK.
Caution: The canary preview of Android Studio 1.3 is still in active development. If you are using your primary development machine to test the developer preview, you can create a second installation of Android Studio to use for testing.
To install the Android Studio 1.3 preview:
On OSX, you can find the Appearance & Behavior panel in Android Studio's Preferences window.
To add the Preview SDK components to your development environment:
On OSX, you can find the Appearance & Behavior panel in Android Studio's Preferences window.
After completing these steps, the preview components are available in your development environment.
In order to use the preview APIs, you must create or update a development project to use the preview components.
We recommend using Android Studio to create a project with the preview. Follow the steps described in Creating a Project until you arrive at the Form Factors screen in the project wizard. Then perform the following steps to create a project configured for the preview.
For existing projects, you must modify the project configuration to enable the preview APIs. In
your development environment, open the build.gradle
file for your module and
set these values as follows:
compileSdkVersion
is set to 'android-MNC'
minSdkVersion
is set to 'MNC'
targetSdkVersion
is set to 'MNC'
Testing an app with the preview requires that you have a device or virtual device configured with the preview version of the platform. If you have a compatible device, you can install the preview platform for testing. Otherwise, you can configure a virtual device for testing.
If you have a Nexus 5, Nexus 6, Nexus 9, or Android TV, you can install a preview system image on these devices for testing your app. You can set up a virtual device with the preview version of the platform from within Android Studio using the Android Virtual Device Manager tool.
Important: Installing a preview image on a device removes all data from it, so you should backup any data before installing a preview image.
You can set up virtual device with the preview version of the platform from within Android Studio using the Android Virtual Device Manager tool.
To create an AVD with the AVD Manager:
For more information about creating virtual devices for testing, see Managing Virtual Devices.