Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

WatchFaceCompanion

public final class WatchFaceCompanion
extends Object

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


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.

Inherited methods

From class java.lang.Object

Constants

EXTRA_PEER_ID

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"

EXTRA_WATCH_FACE_COMPONENT

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"