blob: 876b3481d48d13b7185adcf5dd835ab4b9d128f8 [file] [log] [blame]
Robert Ly20555292014-06-13 23:28:19 -07001page.title=Setting Up the Preview SDK
Robert Ly20555292014-06-13 23:28:19 -07002@jd:body
3
Robert Lyb8cabe92014-06-15 13:04:43 -07004<p>The Preview SDK is available from the Android SDK Manager. <!-- Not yet! -->
5This document assumes that you are familiar with Android app development, such
6as using the Android SDK Manager and creating projects. If you're new to
7Android, see <a href="/training/basics/firstapp/index.html">Building Your First
8App</a> training lesson first.</a></p>
Robert Ly20555292014-06-13 23:28:19 -07009
Andrew Solovay0341fba2014-06-23 11:59:51 -070010<h2 id="downloadSdk">Download the SDK</h2>
Robert Ly20555292014-06-13 23:28:19 -070011
12<ol>
13 <li>Start the Android SDK Manager.</li>
Robert Lyb8cabe92014-06-15 13:04:43 -070014 <li>In the <b>Tools</b> section, select the latest Android <b>SDK Tools</b>,
15 <b>Platform-tools</b>, and <b>Build-tools</b>.</li>
16 <!-- Android L not yet showing up in Android SDK Manager... -->
17 <li>Select everything under the <b>Android L Developer Preview</b> section and
18 click <b>Install packages...</b></li>
19 <li>Accept the Licensing Agreement for all of the packages and click
20 <b>Install</b>.</li>
Robert Ly20555292014-06-13 23:28:19 -070021</ol>
22
Andrew Solovay32fc2b32014-06-24 16:02:32 -070023<p class="note"><strong>Note:</strong> The Eclipse ADT plug-in requires Java 7
24if your compilation target is the L developer preview.</p>
25
Andrew Solovay0341fba2014-06-23 11:59:51 -070026<h2 id="setupHardware">Set Up Hardware and AVDs</h2>
Robert Ly40895832014-06-22 22:07:51 -070027
28<p>The Android L developer preview provides you with 32-bit system images
29to flash the following devices:
30</p>
31
32<ul>
33 <li>Nexus 5</li>
34 <li>Nexus 7 Wi-Fi (version 2, released in 2013)</li>
35</ul>
36
37<p>In addition, you also get the emulator system images, which includes
38experimental 64-bit system images along with standard 32-bit system images.
39</p>
40
Andrew Solovay0341fba2014-06-23 11:59:51 -070041<h3 id="installImage">Install the L Preview System Image</h3>
Robert Ly40895832014-06-22 22:07:51 -070042
Andrew Solovay0341fba2014-06-23 11:59:51 -070043<p class="warning"><b>Warning:</b> This is a preview version of the Android
Robert Ly40895832014-06-22 22:07:51 -070044system image, and is subject to change. Your use of this system image is
45governed by the Android SDK Preview License Agreement. The Android preview
46system image is not a stable release, and may contain errors and defects that
47can result in damage to your computer systems, devices, and data. The preview
48Android system image is not subject to the same testing as the factory OS and
49can cause your phone and installed services and applications to stop working.
50</p>
51
52
53<ol>
Andrew Solovay0341fba2014-06-23 11:59:51 -070054 <li>Download and uncompress the Android Developer Preview package.
55 <p class="table-caption" id="table1">
56 <strong>Table 1.</strong> L Developer Preview system images.</p>
57 <table>
58 <tr>
59 <th scope="col">Device</th>
60 <th scope="col">Download</th>
61 <th scope="col">MD5 Checksum</th>
62 <th scope="col">SHA-1 Checksum</th>
63 </tr>
64 <tr id="hammerhead">
65 <td>Nexus 5 (GSM/LTE) "hammerhead"</td>
66 <td><!-- TODO --></td>
67 <td><code>5a6ae77217978cb7b958a240c2e80b57</code></td>
68 <td><code>ac1d8a8e4f4a1dca5864dc733caa940bffc28616</code></td>
69 </tr>
70 <tr id="razor">
71 <td>Nexus 7 (Wifi) "razor"</td>
72 <td><!-- TODO --></td>
73 <td><code>b293a5d3a4e07beabebcc0be85ad68a2</code></td>
74 <td><code>d0ddf8ce733ba2a34279cdff8827fd604762c2342d</code></td>
75 </tr>
76 </table>
Robert Ly40895832014-06-22 22:07:51 -070077 </li>
Andrew Solovay0341fba2014-06-23 11:59:51 -070078
Robert Ly40895832014-06-22 22:07:51 -070079 <li>Follow the instructions at
80 <a href="https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a>
Andrew Solovay0341fba2014-06-23 11:59:51 -070081 to flash the image onto your device.</li>
Robert Ly40895832014-06-22 22:07:51 -070082</ol>
83
Andrew Solovay0341fba2014-06-23 11:59:51 -070084<h3 id="revertDevice">Revert a Device to Factory Specifications</h3>
Robert Ly40895832014-06-22 22:07:51 -070085
86 <p>If you want to uninstall the L Preview and revert the device to factory
87specifications, go to <a href="http://developers.google.com/android
88/nexus/images">developers.google.com/android</a> and download the image you want
89to flash to for your device. Follow the instructions on that page to flash the
90image to your device.</p>
91
Andrew Solovay0341fba2014-06-23 11:59:51 -070092<h3 id="setupAVD">Set up an AVD</h3>
Robert Ly40895832014-06-22 22:07:51 -070093
94<p>You can set up <a href="{@docRoot}tools/devices/">Android Virtual Devices
95(AVD)</a> and use the emulator to build and test apps with the L Preview.</p>
96
97<p>To create an AVD with the AVD Manager:</p>
98
99<ol>
100 <li>Install the L Preview SDK in your development environment, as described
101 in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview
102 SDK.</a></li>
103 <li>Follow the steps in
104 <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD
105 Manager</a>. Use the following settings:
106 <ul>
107 <li><b>Device:</b> Either Nexus 5 or Nexus 7</li>
108 <li><b>Target:</b> <!-- Confirm exact text when we have final distro -->
109 Android L (Preview) - API Level L</li>
110 </ul>
111 <!-- Confirm this works when you can download image through SDK manager! -->
112 </li>
113</ol>
114
Andrew Solovay0341fba2014-06-23 11:59:51 -0700115<h2 id="createProject">Create a Project</h2>
Robert Ly20555292014-06-13 23:28:19 -0700116
Ricardo Cervera152d7cf2014-06-24 16:19:39 -0700117<p>Android Studio makes it easy to create a project for the L Developer Preview. Follow
118the steps described in <a href="{@docRoot}sdk/installing/create-project.html">Creating a
119Project</a>. In the <strong>Form Factors</strong> screen:</p>
Robert Ly20555292014-06-13 23:28:19 -0700120
Ricardo Cervera152d7cf2014-06-24 16:19:39 -0700121<ul>
122 <li>Check <strong>Phone and Tablet</strong>.</li>
123 <li>Select <strong>API 20+: Android L (Preview)</strong> in <strong>Minimum SDK</strong>.</li>
124</ul>
125
126<p>On the development environment, open the <code>build.gradle</code> file for your module
127and make sure that:</p>
128
129<ul>
130 <li><code>compileSdkVersion</code> is set to <code>'android-L'</code></li>
131 <li><code>minSdkVersion</code> is set to <code>'L'</code></li>
132 <li><code>targetSdkVersion</code> is set to <code>'L'</code></li>
133</ul>
134
135<p>To use the material theme, open the <code>values/styles.xml</code> in your project and make
136sure that you theme extends the material theme:</p>
137
138<pre>
139&lt;resources>
140 &lt;style name="AppTheme" parent="android:Theme.Material">
141 &lt;!-- Customize your theme here -->
142 &lt;/style>
143&lt;/resources>
Robert Ly2d50cda2014-06-25 00:10:34 +0000144</pre>