• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=Get Started with the Preview
2meta.keywords="wear-preview"
3page.tags="wear-preview"
4page.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 of your app, 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 the <a href="{@docRoot}preview/overview.html">N
52      Developer Preview</a>, follow the <a href=
53      "{@docRoot}preview/setup-sdk.html">setup instructions</a> for installing
54      the latest version of Android Studio.
55    </p>
56
57    <p>
58      2. Use the <a href="{@docRoot}tools/help/sdk-manager.html">SDK
59      manager</a> to install or confirm that you have the latest installations
60      of the following packages:
61    </p>
62
63    <ul>
64      <li>Under the <strong>SDK Platforms tab</strong>:
65        <ul>
66          <li>Android N Preview
67          </li>
68        </ul>
69      </li>
70
71      <li>Under the <strong>SDK Tools tab</strong>:
72        <ul>
73          <li>Android Support Library
74          </li>
75
76          <li>Google Play services
77          </li>
78
79          <li>Google Repository
80          </li>
81
82          <li>Android Support Repository
83          </li>
84        </ul>
85      </li>
86    </ul>
87
88    <h2 id="get_the_preview_reference_documentation">
89      Get the Preview Reference Documentation
90    </h2>
91
92    <p>
93      Detailed information about the preview is available in the preview
94      reference documentation, which you can download from the following table.
95      The zip file includes an updated API reference for the preview.
96    </p>
97
98    <table>
99      <tr>
100        <th style="width:300px">
101          Reference documentation
102        </th>
103        <th>
104          Checksums
105        </th>
106      </tr>
107
108      <tr>
109        <td>
110          <a href="http://storage.googleapis.com/androiddevelopers/shareables/wear-preview/wearable-support-preview-2-docs.zip">wearable-support-preview-2-docs.zip</a>
111        </td>
112        <td>MD5: afb770c9c5c0431bbcbdde186f1eae06<br>
113            SHA-1: 81d681e61cee01f222ea82e83297d23c4e55b8f3
114        </td>
115      </tr>
116    </table>
117
118    <h2 id="update_or_create_a_project">
119      Update or Create a Project
120    </h2>
121
122    <p>
123      To use the APIs, your project must be configured appropriately in Android
124      Studio.
125    </p>
126
127    <h3 id="update_an_existing_project">
128      Update an existing project
129    </h3>
130
131    <p>
132      To update an existing project for development:
133    </p>
134
135    <ol>
136      <li>Start Android Studio, click <strong>Open an existing Android Studio
137      Project</strong>, and select a project.
138      </li>
139
140      <li>If prompted by the Android SDK Manager for the SDK version to use for
141      the project, select <strong>Use Android Studio's
142      SDK</strong>.
143      </li>
144
145      <li>If prompted to update the Gradle plugin, update the version of the
146      plugin.
147      </li>
148
149      <li>In the <code>build.gradle</code> file for the Wear module:
150      <ul>
151        <li>In the <code>android</code> section, update the
152        <code>compileSdkVersion</code> to 24.
153        </li>
154
155        <li>In the <code>android</code> section, update the
156        <code>targetSdkVersion</code> to 24.
157        </li>
158
159        <li>In the <code>dependencies</code> section, update
160      the existing reference to the
161      Wearable Support Library (for example, <code>compile
162      'com.google.android.support:wearable:1.4.0'</code>) by changing it to the
163      following, which requires that your the Google Repository <a href=
164      "#install_android_studio_and_the_latest_packages">is the latest
165      version</a>:
166      <code>compile 'com.google.android.support:wearable:2.0.0-alpha2'</code>
167        </li>
168      </ul>
169      </li>
170
171      <li>See the following page for setting up a watch or emulator with a
172      preview system image, in order to begin testing your app: <a href=
173      "{@docRoot}wear/preview/downloads.html">Download and Test with a
174      Device</a>
175      </li>
176    </ol>
177
178    <h3 id="create_a_new_project">
179      Create a new project
180    </h3>
181
182    <p>
183      To create a new project for development:
184    </p>
185
186    <ol>
187      <li>Click <strong>File &gt; New Project</strong> and follow the steps in
188      the Create New Project wizard until you reach the Target Android Devices
189      page.
190      </li>
191
192      <li>Optionally, select the <strong>Phone and Tablet</strong> option. If
193      you plan to use N Preview APIs in a phone app, then the Minimum SDK
194      option list, select <strong>API N: Android 6.x (N Preview)</strong>.
195      </li>
196
197      <li>Select the <strong>Wear</strong> option, and in the Minimum SDK
198      option list, select the latest available (<strong>N Preview</strong>)
199      option. Click <strong>Next</strong> until you exit the Create New Project
200      wizard.
201      </li>
202
203      <li>In the <code>build.gradle</code> file for the Wear module:
204      <ul>
205        <li>In the <code>android</code> section, update the
206        <code>compileSdkVersion</code> to 24.
207        </li>
208        <li>In the <code>android</code> section, update the
209        <code>targetSdkVersion</code> to 24.
210        </li>
211        <li>In the <code>dependencies</code> section, update
212      the existing reference to the
213      Wearable Support Library (for example, <code>compile
214      'com.google.android.support:wearable:1.4.0'</code>) by changing it to the
215      following, which requires that your the Google Repository <a href=
216      "#install_android_studio_and_the_latest_packages">is the latest
217      version</a>:
218      <code>compile 'com.google.android.support:wearable:2.0.0-alpha2'</code>
219        </li>
220      </ul>
221      </li>
222
223      <li>See the following page for setting up a watch or emulator with a
224      preview system image, in order to begin testing your app: <a href=
225      "{@docRoot}wear/preview/downloads.html">Download and Test with a
226      Device</a>
227      </li>
228    </ol>
229