Search code examples
androidwear-oswatch-face-apiwatchface

android watch selection menu options?


How are selection options added to watch selection menu.

Some watches (eg InstaWeather) show a gear under the the selection thumbnail, and clicking the gear offers settings.

Unfortunately, I could not find source code for the InstaWeather watch.

But it must be possible.


Solution

  • Per the Providing Configuration Activities training:

    Watch faces that support configuration parameters can let users customize a watch face using an activity in the wearable app, an activity on the handheld app, or both. Users can start the wearable configuration activity on the wearable device, and they can start the companion configuration activity from the Android Wear companion app.

    The sample code includes how to add a wearable configuration activity:

    <service
      android:name=".DigitalWatchFaceService" ... />
      <!-- companion configuration activity -->
      <meta-data
        android:name=
           "com.google.android.wearable.watchface.companionConfigurationAction"
        android:value=
           "com.example.android.wearable.watchface.CONFIG_DIGITAL" />
      <!-- wearable configuration activity -->
      <meta-data
        android:name=
           "com.google.android.wearable.watchface.wearableConfigurationAction"
        android:value=
           "com.example.android.wearable.watchface.CONFIG_DIGITAL" />
      ...
    </service>