• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=Creating Wearable Apps
2page.image=wear/images/notifications.png
3
4@jd:body
5
6<div id="tb-wrapper">
7<div id="tb">
8  <h2>Dependencies and Prerequisites</h2>
9  <ul>
10    <li>Android Studio 0.8 or later and Gradle 0.12 or later</li>
11  </ul>
12</div>
13</div>
14
15<p>
16Wearable apps run directly on the device, giving you access to hardware such as sensors and the
17GPU. They are fundamentally the same as apps built for other devices using the Android SDK, but
18differ greatly in design and usability and the amount of functionality provided.
19These are the main differences between handheld and wearable apps:</p>
20
21<ul>
22  <li>The system enforces a timeout period. If you are displaying an activity and user's don't
23  interact with it, the device sleeps. When it wakes back up, the Wear home screen is displayed
24  instead of your activity. If you need to show something persistent, create a notification in the
25  context stream instead.</li>
26  <li>Wearable apps are relatively small in size and functionality compared to handheld apps.
27  They contain only what makes sense on the wearable, which is usually a small
28  subset of the corresponding handheld app. In general, you should carry out operations on the
29  handheld when possible and send the results to the wearable.
30  </li>
31  <li>Users don't download apps directly onto the wearable. Instead, you bundle
32  the wearable app inside the handheld app. When users install the handheld app,
33  the system automatically installs the wearable app. However, for development
34  purposes, you can still install the wearable app directly to the wearable.</li>
35  <li><p>Wearable apps can access much of the standard Android APIs, but don't support
36  the following APIs:</p>
37  <ul>
38    <li>{@link android.webkit}</li>
39    <li>{@link android.print}</li>
40    <li>{@link android.app.backup}</li>
41    <li>{@link android.appwidget}</li>
42    <li>{@link android.hardware.usb}</li>
43  </ul>
44  <p>
45  You can check if a wearable supports a feature by calling
46  {@link android.content.pm.PackageManager#hasSystemFeature hasSystemFeature()}
47  before trying to use an API.</p>
48</li>
49</ul>
50
51<p class="note"><b>Note:</b> We recommend using Android Studio for Android Wear development
52as it provides project setup, library inclusion, and packaging conveniences that aren't available
53in ADT. The rest of this training assumes you're using Android Studio.
54</p>
55
56<h2>Lessons</h2>
57  <dl>
58    <dt><a href="{@docRoot}training/wearables/apps/creating.html">Creating and Running a Wearable App</a></dt>
59      <dd>Learn how to create an Android Studio project that
60      contains both the wearable and handheld app modules and how to run the app on a device
61      or emulator.</dd>
62    <dt><a href="{@docRoot}training/wearables/apps/layouts.html">Creating Custom Layouts</a></dt>
63      <dd>Learn how to create and display custom layouts for notifications and
64      activities.</dd>
65    <dt><a href="{@docRoot}training/wearables/apps/voice.html">Adding Voice Capabilities</a></dt>
66      <dd>Learn how to launch an activity with a voice actions and how to start the
67      system speech recognizer app to obtain free-form voice input.</dd>
68    <dt><a href="{@docRoot}training/wearables/apps/packaging.html">Packaging Wearable Apps</a></dt>
69      <dd>Learn how to package a wearable app inside a
70      handheld app. This allows the system to install the wearable app automatically when
71      users install the companion handheld app from the Google Play store.</dd>
72    <dt><a href="{@docRoot}training/wearables/apps/bt-debugging.html">Debugging over Bluetooth</a></dt>
73      <dd>Learn how to debug your wearable over Bluetooth instead of USB.</dd>
74  </dl>