1 page.title=Get Started with the Preview 2 meta.keywords="wear-preview" 3 page.tags="wear-preview" 4 page.image=images/cards/card-n-sdk_2x.png 5 6 @jd:body 7 8 9 <div id="qv-wrapper"> 10 <div id="qv"> 11 <ol> 12 <li> 13 <a href="#install_android_studio_and_the_latest_packages">Install 14 Android Studio and the Latest Packages</a> 15 </li> 16 17 <li> 18 <a href="#get_the_preview_reference_documentation">Get the Preview 19 Reference Documentation</a> 20 </li> 21 22 <li> 23 <a href="#update_or_create_a_project">Update or Create a 24 Project</a> 25 </li> 26 </ol> 27 </div> 28 </div> 29 30 <p> 31 If you want an environment for basic compatibility 32 testing, you can use your current APK and a 33 supported watch or an emulator. You don't necessarily need to update your 34 full development environment to do basic testing. To simply test your 35 app's compatibility with a preview system image, see <a href= 36 "{@docRoot}wear/preview/downloads.html">Download and Test with a 37 Device</a>. 38 </p> 39 40 <p> 41 However, to develop apps for the Android Wear 2.0 Developer Preview, you 42 need to make some updates to your development environment, as described 43 below. 44 </p> 45 46 <h2 id="install_android_studio_and_the_latest_packages"> 47 Install Android Studio and the Latest Packages 48 </h2> 49 50 <p> 51 1. For compatibility with Android 7.0, install the latest version of 52 <a href="https://developer.android.com/studio/index.html">Android Studio</a>. 53 </p> 54 55 <p> 56 2. Use the <a href="{@docRoot}tools/help/sdk-manager.html">SDK 57 manager</a> to install or confirm that you have the latest installations 58 of the following packages: 59 </p> 60 61 <ul> 62 <li>Under the <strong>SDK Platforms tab</strong>: 63 <ul> 64 <li>Android 7.0 (Nougat) 65 </li> 66 </ul> 67 </li> 68 69 <li>Under the <strong>SDK Tools tab</strong>: 70 <ul> 71 <li>Android Support Library 72 </li> 73 74 <li>Google Play services 75 </li> 76 77 <li>Google Repository 78 </li> 79 80 <li>Android Support Repository 81 </li> 82 </ul> 83 </li> 84 </ul> 85 86 <h2 id="get_the_preview_reference_documentation"> 87 Get the Preview Reference Documentation 88 </h2> 89 90 <p> 91 Detailed information about the preview is available in the preview 92 reference documentation, which you can download from the following table. 93 The zip file includes an updated API reference for the preview. 94 </p> 95 96 <table> 97 <tr> 98 <th style="width:300px"> 99 Reference documentation 100 </th> 101 <th> 102 Checksums 103 </th> 104 </tr> 105 106 <tr> 107 <td> 108 <a href="http://storage.googleapis.com/androiddevelopers/shareables/wear-preview/wearable-support-preview-3-docs.zip">wearable-support-preview-3-docs.zip</a> 109 </td> 110 <td>MD5: 22bae00e473e39e320aae8ea09a001a5<br> 111 SHA-1: 474502cc7092bcf0bd671441b8654aa8d6c155ed 112 </td> 113 </tr> 114 </table> 115 116 <h2 id="update_or_create_a_project"> 117 Update or Create a Project 118 </h2> 119 120 <p> 121 To use the APIs, your project must be configured appropriately in Android 122 Studio. 123 </p> 124 125 <h3 id="update_an_existing_project"> 126 Update an existing project 127 </h3> 128 129 <p> 130 To update an existing project for development: 131 </p> 132 133 <ol> 134 <li>Start Android Studio, click <strong>Open an existing Android Studio 135 Project</strong>, and select a project. 136 </li> 137 138 <li>If prompted by the Android SDK Manager for the SDK version to use for 139 the project, select <strong>Use Android Studio's 140 SDK</strong>. 141 </li> 142 143 <li>If prompted to update the Gradle plugin, update the version of the 144 plugin. 145 </li> 146 147 <li>In the <code>build.gradle</code> file for the Wear module: 148 <ul> 149 <li>In the <code>android</code> section, update the 150 <code>compileSdkVersion</code> to 24. 151 </li> 152 153 <li>In the <code>android</code> section, update the 154 <code>targetSdkVersion</code> to 24. 155 </li> 156 157 <li>In the <code>dependencies</code> section, update 158 the existing reference to the 159 Wearable Support Library (for example, <code>compile 160 'com.google.android.support:wearable:1.4.0'</code>) by changing it to the 161 following, which requires that your the Google Repository <a href= 162 "#install_android_studio_and_the_latest_packages">is the latest 163 version</a>: 164 <code>compile 'com.google.android.support:wearable:2.0.0-alpha3'</code> 165 </li> 166 </ul> 167 </li> 168 169 <li>See the following page for setting up a watch or emulator with a 170 preview system image, in order to begin testing your app: <a href= 171 "{@docRoot}wear/preview/downloads.html">Download and Test with a 172 Device</a> 173 </li> 174 </ol> 175 176 <h3 id="create_a_new_project"> 177 Create a new project 178 </h3> 179 180 <p> 181 To create a new project for development: 182 </p> 183 184 <ol> 185 <li>Click <strong>File > New Project</strong> and follow the steps in 186 the Create New Project wizard until you reach the Target Android Devices 187 page. 188 </li> 189 190 <li>Optionally, select the <strong>Phone and Tablet</strong> option. If 191 you plan to use Android 7.0 APIs in a phone app, then the Minimum SDK 192 option list, select <strong>API 24: Android 7.0 (Nougat)</strong>. 193 </li> 194 195 <li>Select the <strong>Wear</strong> option, and in the Minimum SDK 196 option list, select the latest available (<strong>API Nougat</strong>) 197 option. Click <strong>Next</strong> until you exit the Create New Project 198 wizard. 199 </li> 200 201 <li>In the <code>build.gradle</code> file for the Wear module: 202 <ul> 203 <li>In the <code>android</code> section, update the 204 <code>compileSdkVersion</code> to 24. 205 </li> 206 <li>In the <code>android</code> section, update the 207 <code>targetSdkVersion</code> to 24. 208 </li> 209 <li>In the <code>dependencies</code> section, update 210 the existing reference to the 211 Wearable Support Library (for example, <code>compile 212 'com.google.android.support:wearable:1.4.0'</code>) by changing it to the 213 following, which requires that your the Google Repository <a href= 214 "#install_android_studio_and_the_latest_packages">is the latest 215 version</a>: 216 <code>compile 'com.google.android.support:wearable:2.0.0-alpha3'</code> 217 </li> 218 </ul> 219 </li> 220 221 <li>See the following page for setting up a watch or emulator with a 222 preview system image, in order to begin testing your app: <a href= 223 "{@docRoot}wear/preview/downloads.html">Download and Test with a 224 Device</a> 225 </li> 226 </ol> 227