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