I am just getting started on developing an Android Wear companion app for my handheld application. I have been going through the developer documents, and I am looking to get data from the handheld to view on the wearable. I am looking to use a listener activity that implements DataApi.DataListener
to get data from the handheld device, shown here: Handling Data Layer Events. In my case, the wearable is only getting data from the handheld, never the reverse. As it says under the heading With a WearableListenerService:
...you can have a handheld app that sets and gets data item objects and a wearable app that listens for these updates to update it's UI. The wearable never updates any of the data items, so the handheld app doesn't listen for any data events from the wearable app.
The handheld does not need to listen for data events from the wearable, so what kind of service or otherwise would I use to get and set data on the handheld to receive on the wearable? I would like to be able to get data from the handheld at any time, even if the handheld application is closed, and if the device is locked. This data would be data I would be obtaining from a server, and possibly location data of the user as well. I also would like to be able to update this data when the wearable application is opened (or on a button press). So would I need to implement a listener service on the handheld as well, just to get information on when the wearable application is opened?