Ethan Peacock
Ethan Peacock

Reputation: 31

Adding a settings icon to toggle configuration for Watch Face (Android Wear)

I currently have an android wear watch face developed. I recently tried implementing configurations to the users. Everything works except I cannot figure out what I am doing wrong to not get a settings icon under my watch face.

If anyone could help and tell me what I'm doing wrong I would really appreciate it!

Here is the code to add wearable configurations from my manifest file.

 <service
    android:name=".EleganceTick"
    android:label="@string/analog_name"
    android:permission="android.permission.BIND_WALLPAPER" >
    <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/preview_analog_circular" />
    <meta-data
        android:name="com.google.android.wearable.watchface.preview_circular"
        android:resource="@drawable/preview_analog_circular" />
    <meta-data
        android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
        android:value="com.peacockethan.elegancewatchface.watchface.CONFIG_ELEGANCE" />
    <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=".EleganceWatchFaceWearableConfigActivity"
    android:label="Elegance watch face configuration" >
    <intent-filter>
        <action android:name="com.peacockethan.elegancewatchface.wearable.watchface.CONFIG_ELEGANCE" />
        <category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
        <category android:name="android.intent.category.default" />
    </intent-filter>

</activity>

Upvotes: 3

Views: 515

Answers (2)

sam
sam

Reputation: 4397

In your companion app manifest add the below:

 <meta-data android:name="com.google.android.wearable.beta.app"
             android:resource="@xml/watch_face"/>

And make sure you have the same version in both manifests and in the watch_face.xml file on the app side

Upvotes: 1

rana_sadam
rana_sadam

Reputation: 1226

add this to the service tag in wear menifest.

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

add this intent filter to the activity tag in mobile

                      <action android:name="com.frillroid.watchface.CONFIG_ANALOG" />
                      <category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
                      <category android:name="android.intent.category.DEFAULT" />

Upvotes: 0

Related Questions