Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 1 | page.title=Setting Up the Preview SDK |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 2 | @jd:body |
| 3 | |
Robert Ly | b8cabe9 | 2014-06-15 13:04:43 -0700 | [diff] [blame] | 4 | <p>The Preview SDK is available from the Android SDK Manager. <!-- Not yet! --> |
| 5 | This document assumes that you are familiar with Android app development, such |
| 6 | as using the Android SDK Manager and creating projects. If you're new to |
| 7 | Android, see <a href="/training/basics/firstapp/index.html">Building Your First |
| 8 | App</a> training lesson first.</a></p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 9 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 10 | <h2 id="downloadSdk">Download the SDK</h2> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 11 | |
| 12 | <ol> |
| 13 | <li>Start the Android SDK Manager.</li> |
Robert Ly | b8cabe9 | 2014-06-15 13:04:43 -0700 | [diff] [blame] | 14 | <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 Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 21 | </ol> |
| 22 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 23 | <h2 id="setupHardware">Set Up Hardware and AVDs</h2> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 24 | |
| 25 | <p>The Android L developer preview provides you with 32-bit system images |
| 26 | to flash the following devices: |
| 27 | </p> |
| 28 | |
| 29 | <ul> |
| 30 | <li>Nexus 5</li> |
| 31 | <li>Nexus 7 Wi-Fi (version 2, released in 2013)</li> |
| 32 | </ul> |
| 33 | |
| 34 | <p>In addition, you also get the emulator system images, which includes |
| 35 | experimental 64-bit system images along with standard 32-bit system images. |
| 36 | </p> |
| 37 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 38 | <h3 id="installImage">Install the L Preview System Image</h3> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 39 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 40 | <p class="warning"><b>Warning:</b> This is a preview version of the Android |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 41 | system image, and is subject to change. Your use of this system image is |
| 42 | governed by the Android SDK Preview License Agreement. The Android preview |
| 43 | system image is not a stable release, and may contain errors and defects that |
| 44 | can result in damage to your computer systems, devices, and data. The preview |
| 45 | Android system image is not subject to the same testing as the factory OS and |
| 46 | can cause your phone and installed services and applications to stop working. |
| 47 | </p> |
| 48 | |
| 49 | |
| 50 | <ol> |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 51 | <li>Download and uncompress the Android Developer Preview package. |
| 52 | <p class="table-caption" id="table1"> |
| 53 | <strong>Table 1.</strong> L Developer Preview system images.</p> |
| 54 | <table> |
| 55 | <tr> |
| 56 | <th scope="col">Device</th> |
| 57 | <th scope="col">Download</th> |
| 58 | <th scope="col">MD5 Checksum</th> |
| 59 | <th scope="col">SHA-1 Checksum</th> |
| 60 | </tr> |
| 61 | <tr id="hammerhead"> |
| 62 | <td>Nexus 5 (GSM/LTE) "hammerhead"</td> |
| 63 | <td><!-- TODO --></td> |
| 64 | <td><code>5a6ae77217978cb7b958a240c2e80b57</code></td> |
| 65 | <td><code>ac1d8a8e4f4a1dca5864dc733caa940bffc28616</code></td> |
| 66 | </tr> |
| 67 | <tr id="razor"> |
| 68 | <td>Nexus 7 (Wifi) "razor"</td> |
| 69 | <td><!-- TODO --></td> |
| 70 | <td><code>b293a5d3a4e07beabebcc0be85ad68a2</code></td> |
| 71 | <td><code>d0ddf8ce733ba2a34279cdff8827fd604762c2342d</code></td> |
| 72 | </tr> |
| 73 | </table> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 74 | </li> |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 75 | |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 76 | <li>Follow the instructions at |
| 77 | <a href="https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a> |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 78 | to flash the image onto your device.</li> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 79 | </ol> |
| 80 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 81 | <h3 id="revertDevice">Revert a Device to Factory Specifications</h3> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 82 | |
| 83 | <p>If you want to uninstall the L Preview and revert the device to factory |
| 84 | specifications, go to <a href="http://developers.google.com/android |
| 85 | /nexus/images">developers.google.com/android</a> and download the image you want |
| 86 | to flash to for your device. Follow the instructions on that page to flash the |
| 87 | image to your device.</p> |
| 88 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 89 | <h3 id="setupAVD">Set up an AVD</h3> |
Robert Ly | 4089583 | 2014-06-22 22:07:51 -0700 | [diff] [blame] | 90 | |
| 91 | <p>You can set up <a href="{@docRoot}tools/devices/">Android Virtual Devices |
| 92 | (AVD)</a> and use the emulator to build and test apps with the L Preview.</p> |
| 93 | |
| 94 | <p>To create an AVD with the AVD Manager:</p> |
| 95 | |
| 96 | <ol> |
| 97 | <li>Install the L Preview SDK in your development environment, as described |
| 98 | in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview |
| 99 | SDK.</a></li> |
| 100 | <li>Follow the steps in |
| 101 | <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD |
| 102 | Manager</a>. Use the following settings: |
| 103 | <ul> |
| 104 | <li><b>Device:</b> Either Nexus 5 or Nexus 7</li> |
| 105 | <li><b>Target:</b> <!-- Confirm exact text when we have final distro --> |
| 106 | Android L (Preview) - API Level L</li> |
| 107 | </ul> |
| 108 | <!-- Confirm this works when you can download image through SDK manager! --> |
| 109 | </li> |
| 110 | </ol> |
| 111 | |
Andrew Solovay | 0341fba | 2014-06-23 11:59:51 -0700 | [diff] [blame] | 112 | <h2 id="createProject">Create a Project</h2> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 113 | |
Ricardo Cervera | 152d7cf | 2014-06-24 16:19:39 -0700 | [diff] [blame^] | 114 | <p>Android Studio makes it easy to create a project for the L Developer Preview. Follow |
| 115 | the steps described in <a href="{@docRoot}sdk/installing/create-project.html">Creating a |
| 116 | Project</a>. In the <strong>Form Factors</strong> screen:</p> |
Robert Ly | 2055529 | 2014-06-13 23:28:19 -0700 | [diff] [blame] | 117 | |
Ricardo Cervera | 152d7cf | 2014-06-24 16:19:39 -0700 | [diff] [blame^] | 118 | <ul> |
| 119 | <li>Check <strong>Phone and Tablet</strong>.</li> |
| 120 | <li>Select <strong>API 20+: Android L (Preview)</strong> in <strong>Minimum SDK</strong>.</li> |
| 121 | </ul> |
| 122 | |
| 123 | <p>On the development environment, open the <code>build.gradle</code> file for your module |
| 124 | and make sure that:</p> |
| 125 | |
| 126 | <ul> |
| 127 | <li><code>compileSdkVersion</code> is set to <code>'android-L'</code></li> |
| 128 | <li><code>minSdkVersion</code> is set to <code>'L'</code></li> |
| 129 | <li><code>targetSdkVersion</code> is set to <code>'L'</code></li> |
| 130 | </ul> |
| 131 | |
| 132 | <p>To use the material theme, open the <code>values/styles.xml</code> in your project and make |
| 133 | sure that you theme extends the material theme:</p> |
| 134 | |
| 135 | <pre> |
| 136 | <resources> |
| 137 | <style name="AppTheme" parent="android:Theme.Material"> |
| 138 | <!-- Customize your theme here --> |
| 139 | </style> |
| 140 | </resources> |
| 141 | </pre> |