Reputation: 2334
How do I start a standard Service
on my mobile device from a watch face? Would I need to use the Message API? If so, what would be the correct way of doing this? I currently only start the Service
on the mobile's boot and when I open the config activity.
Upvotes: 0
Views: 88
Reputation: 6635
Yes, you'll need to use the Message API. You'll find it well documented at https://developer.android.com/training/wearables/data-layer; if you subclass WearableListenerService
on the handheld, it will start automatically when a message is sent from the watch. This could be your existing service (just change it from extends Service
to extends WearableListenerService
), or you could leave your existing service unchanged and start it from the new WearableListenerService
when a message arrives.
Upvotes: 2