0

I am new in Android wearable app development and recently I came to know that Watch Face API is also now available for Android. So I want to develop wearable app of my mobile app and also I want to develop watch face of that same app.

Can anyone suggest me is this possible or not? As I know that the layout file of wearable app and watch face are same (activity_main.xml). So how can I develop design of watch and wearable app?

I am stuck with this confusion. Please let me know the feasibility.

Thanks in advance.

anddev
  • 3,144
  • 12
  • 39
  • 70

2 Answers2

0

For creating a watchface you need to create a service using CanvasWatchFaceService class

Watch faces in Android Wear are implemented as services. When a watch face is active, the system invokes the methods in its service when the time changes or when an important event occurs (like switching to ambient mode or receiving a new notification). The service implementation then draws the watch face on the screen using the updated time and any other relevant data.

You may follow this https://developer.android.com/training/wearables/watch-faces/designing.html step by step to create your watchface

Zeba
  • 3,041
  • 1
  • 28
  • 39
0

For wear development, refer to the following:

Creating and running a wearable app

You can run a debug wearable app over bluetooth by following this reference:

Debugging over bluetooth

If you want to test your app on the android wear handheld application, you will need to build a signed release apk and upload it to your mobile device. For this procedure, read the following:

Assuming you use android studio:

Your mobile build.gradle file should have the following dependency:

dependencies {
   ...
   wearApp project(':wear')
}

Go to Build > Generate signed apk. In the first window, select mobile as your module.

Now when the build is complete, the wear module will automatically be embedded into the mobile module. The mobile apk is the one you distribute. Wear can be used for testing.

osthoro
  • 41
  • 4