Search code examples
configurationwear-oswatch-face-api

Android Wear companion activity gear does not show up in watch face


I wanted to provide a Companion Configuration Activity for my Android Wear watch face. I have already build the app that has all the configuration and can communicate directly with the watch face, but I can only launch it from the launcher as app, but the gear does not show up in the watch face section of Android Wear app! Can I allow user to configure the watch face via companion app and also via Google Android Wear app?

This is how I declare my activity in phone module:

    <activity
        android:name=".Main"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND"></action>
            <category android:name="android.intent.category.DEFAULT"></category>
            <data android:mimeType="image/*"></data>
        </intent-filter>
    </activity>

On the watch part, I added in:

        <meta-data
            android:name=
            "com.google.android.wearable.watchface.companionConfigurationAction"
            android:value=
                "virtualgs.photowatch.Main" />

        <meta-data
            android:name=
                "com.google.android.wearable.watchface.wearableConfigurationAction"
            android:value=
                "virtualgs.photowatch.Main" />

And the result is the same - no gear shown on the Android Wear app.


Solution

  • Try something like this:

    Phone Manifest:

    <intent-filter>
            <action android:name="com.virtualgs.photowatch.MAIN_CONFIG" />
            <category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
            <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    

    Watch Manifest:

        <meta-data
                android:name="com.google.android.wearable.watchface.companionConfigurationAction"
                android:value="com.virtualgs.photowatch.MAIN_CONFIG" />
    

    I think the intent action in the phone manifest has to be the same as the meta-data value in the watch manifest to work.