且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将数据从移动应用发送到Android Wear延迟

更新时间:2023-01-01 18:14:55

从Play Services 8.3开始,使用DataApi进行数据同步已批量处理,以一定的频率完成操作,这意味着您的数据同步最多可延迟30分钟。如果需要立即同步,则需要确保将请求设置为紧急


I'm trying to sync data between a settings app and a watch face and I'm having no luck. I've tried using a googleApiClient with listeners & onDataChanged and DataMaps, but there is a huge delay on the wear device to receive the data. (I'm talking like 5 minutes or more from being sent on from the mobile).

I've also tried to use Teleport Library for Wearable and I can confirm it works on the mobile side, but I receive nothing on the wear side.

Is there typically a huge delay with sync setting options? What's the best way to communicate between mobile and wear?

Starting with Play Services 8.3, data synchronization using DataApi is batched up and done with a certain frequency which means synchronization of your data can be delayed up to 30 minutes. If you need immediate sync, you need to make sure your request is set as urgent.