The main purpose of this app is to open your watch face’s Google Play Store page directly on the connected Wear OS smartwatch with a simple click.
Additional features:
- Opens your google developer's page to showcase other apps
- Directs users to review section of the watch face to rate it
Bonus: support of light/dark themes
NOTE:
- companion app's package should be the same as the watch face package
- all the steps bellow suppose the use of
Project
project view - most of the changes are supposed to be done in the
scr > main
folder (app module) - the build can be tested on the device either before step.2 or after step.4. simply
File > Sync Project with Gradle Files
- everything is done in Android Studio v2023.2.1.25
Open Android Studio and select Get from Version Control
. Enter the URL of this GitHub repository and click Clone
. The project will be downloaded and opened automatically in Android Studio.
On the repository page click Code > Download ZIP
. Extract content to the preferred folder. Open Android Studio and select Open an existing Android Studio project
. Navigate to the directory where you extracted the project and open it.
In the Project pane, go to the Options (3 dots) > Tree appearance > Compact Middle Packages
and uncheck/de-select it. Your package directory will now be broken up into individual directories (com > android > wf_companion_app >...
).
Individually select each directory(android
, wf_companion_app
) and:
- Right-click it
- Select
Refactor
- Click on
Rename
- In the Pop-up dialog, click on
All Directories
- Enter the new name and hit
Refactor
- Allow a minute to let Android Studio update all changes.
Eventually you should have com.your_comany.your_app_name
and the corresponding project structure.
Open the AndroidManifest.xml
file. Find the <activity>
tag and change the android:name
attribute to your new package namespace (leave .MainActivity
in the end).
Open the build.gradle.kts
file in the app
directory.
- Find the
android
block and change thenamespace
to your new package name. - Find the
defaultConfig
block and change theapplicationId
to your new package name.
Right-click the res folder and go to New > Image Asset
. On the Foreground Layer
tab, select the Asset Type
to Image
and browse to the new icon you want.
On the Background Layer
tab, select the Asset Type
to Color
and pick a color of your choice. Click Next > Finish
and the icon should be changed.
Go to res > drawable
to find the wf_img.png
. You can replace an existing image by right-clicking it and selecting Reveal in Finder
(or Show in Explorer
for Windows), then replace the file there with your new image (it should have the same name and format).
If you want to add a new image, simply copy and paste your image file into the res/drawable
directory. You can then use this image in your project by referencing it as @drawable/your_image_name
.
Go to res > values
to find strings.xml
. Change name="app_name"
entry to your desired app name.
Go to res > values
to find strings.xml
. Change name="dev_id"
entry to your google play developer ID (to open your dev page when user clicks 'more apps' button).
After you've made these changes, be sure to sync your project with Gradle files. You can do this by clicking on File > Sync Project with Gradle Files
.
Run your project on the connected or emulated device to see the changes take effect.
Click Build > Generate signed Bundle/APK...
. Sign with the same keystore & alias used for the watch face build.