Android Wear Development Guide: From Hello World to Communication and Publishing
This guide walks developers through creating a Wear OS “Hello World” app, handling ambient mode, using BoxInsetLayout, configuring Gradle for phone‑watch communication, implementing MessageApi/DataApi with GoogleApiClient, exploring Wear 2.0 features, and packaging the watch APK for publishing on Google Play.
Android Wear (now Wear OS) has evolved from version 1.0 (Bluetooth‑only) to 2.0, which adds Wi‑Fi, 3G/4G and can operate independently of a phone.
The guide explains how to create a “Hello World” wearable app using Android Studio’s Wear wizard, shows the generated MainActivity that extends WearableActivity , and describes ambient mode callbacks (onEnterAmbient, onUpdateAmbient, onExitAmbient) and the need to call setAmbientEnabled() .
It introduces the BoxInsetLayout for circular and square screens and the use of layout_box attributes.
For projects that require phone‑wear communication, the tutorial details manual Gradle configuration for both the watch and phone modules, including the Chinese‑specific Google Play Services Wearable library (e.g., com.google.android.gms:play-services-wearable:7.5.0 and play-services-wearable-standalone-7.5.0.aar ), and stresses matching package name and signing certificate on both sides.
The communication mechanisms are covered: traditional notification bridging, MessageApi, DataApi, and the required GoogleApiClient setup with connection callbacks. Sample code snippets illustrate building a notification with NotificationCompat.WearableExtender , establishing a GoogleApiClient, sending messages via Wearable.MessageApi.sendMessage , and syncing data with Wearable.DataApi.putDataItem . Listener interfaces (MessageListener, DataListener, WearableListenerService) are also shown.
New features in Wear 2.0 are listed: Wi‑Fi/Cellular connectivity, customizable watch faces, smart reply, handwriting recognition, full‑keyboard input, and a Wearable Navigation Drawer for quick actions.
Finally, the article explains how to package and publish a wearable app, including placing the watch APK in res/raw , creating a <wearableApp> descriptor XML, adding the appropriate meta‑data tag in the phone app’s manifest, and disabling asset compression to avoid installation errors.
Reference links to the official Android Wear developer documentation are provided.
Tencent Music Tech Team
Public account of Tencent Music's development team, focusing on technology sharing and communication.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.