Using Data API changes to update watch face UI

前端 未结 3 836
挽巷
挽巷 2021-01-14 22:44

I\'m using the Data API in a service for Android Wear in a watch face that pulls down data from the cloud in a phone app and syncs it through a DataMap to the paired watch a

3条回答
  •  礼貌的吻别
    2021-01-14 23:27

    While having separate service could definitely fit the bill, I was researching for possibly having just one service for both CanvasWatchFaceService and being registered for Data Layers API, and seems the DigitalWatchFaceService in the Google sample/android-WatchFace provide an example of this.

    Notice it provide example to register both as BroadcastReceiver AND the Data API.

    Hope this helps.

    https://github.com/googlesamples/android-WatchFace/blob/master/Wearable/src/main/java/com/example/android/wearable/watchface/DigitalWatchFaceService.java

提交回复
热议问题