public final class

WatchFaceCompanion

extends Object

Note: The Wearable Support Library classes under the android.support.wearable package are subject to change. For the full Android API reference, see Reference.

java.lang.Object
   ↳ android.support.wearable.companion.WatchFaceCompanion

Class Overview

Constants for use by watch face configuration activities.

To register a configuration activity for a watch face, add a <meta-data> entry to the watch face component in its Android Manifest file with an intent action to be fired to start the activity. The following meta-data will register the com.example.watchface.CONFIG_DIGITAL action to be started when configuring a watch face on the wearable device:

 <meta-data
     android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
     android:value="com.example.watchface.CONFIG_DIGITAL" />

To register a configuration activity to be started on a companion phone, add the following alternative meta-data entry to the watch face component:

 <meta-data
     android:name="com.google.android.wearable.watchface.companionConfigurationAction"
     android:value="com.example.watchface.CONFIG_DIGITAL" />

The activity should have an intent filter which lists the action specified in the meta-data block above, in addition to the two categories present in the following example:

 <activity android:name=".MyWatchFaceConfigActivity">
     <intent-filter>
         <action android:name="com.example.watchface.CONFIG_DIGITAL" />
         <category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
         <category android:name="android.intent.category.DEFAULT" />
     </intent-filter>
 </activity>

For phone side configuration activities, substitute the category com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION for com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION.

Summary

Constants
String EXTRA_PEER_ID The key for String extra specifying the ID of the currently connected device in the phone-side config activity launch Intent.
String EXTRA_WATCH_FACE_COMPONENT The key for String extra specifying a ComponentName of the watch face being configured in the config activity launch Intent.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String EXTRA_PEER_ID

The key for String extra specifying the ID of the currently connected device in the phone-side config activity launch Intent.

Constant Value: "android.support.wearable.watchface.extra.PEER_ID"

public static final String EXTRA_WATCH_FACE_COMPONENT

The key for String extra specifying a ComponentName of the watch face being configured in the config activity launch Intent.

Constant Value: "android.support.wearable.watchface.extra.WATCH_FACE_COMPONENT"