Im a noob and Im having a hard time understanding the guide for making a simple configuration activity for the wearable to be able to change the background of my watch face. The documentation makes it seem simple but when I copy the code and change to my package name i dont see anything. Can anyone explain in idiot terms because the developer website is very vague.
Asked
Active
Viewed 194 times
1 Answers
0
You need to add the following lines to your watch face service entry in your AndroidManifest.xml:
<!-- wearable configuration activity -->
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="com.your.package.CONFIG" />
Then, you need to make sure that your configuration activity has the following intent-filter:
<intent-filter>
<action android:name="com.your.package.CONFIG" />
<category android:name=
"com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Do NOT change com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION to use your own package name! Same goes with com.google.android.wearable.watchface.wearableConfigurationAction above; these values must match exactly as they are here - only use your package name where I put com.your.package.
Here are the manifest entries for the watch face service and configuration activity from one of my own projects so you can see both of these changes in action:
<service
android:name=".WatchFaceService"
android:allowEmbedded="true"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER"
android:taskAffinity="" >
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watch_face_preview" />
<!-- wearable configuration activity -->
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="com.your.package.CONFIG" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
<activity
android:name=".WearableConfigActivity"
android:label="@string/title_activity_wearable_config" >
<intent-filter>
<action android:name="com.your.package.CONFIG" />
<category android:name=
"com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Tony Wickham
- 4,706
- 3
- 29
- 35