I am developing a couple of applications for Android watches / phones where the watch and phone communicate using the Data API.
I need to send messages immediately or with a delay of a few minutes maximum (not 30 minutes). To achieve this, I call setUrgent()on my PutDataRequest .
For reasons I don’t understand, the message still takes a very long time to deliver.
The message is sent immediately if I try to play with the Android Wear app that changes the face of the time zone. In addition, after the first message has been delivered, others seem to immediately begin the passage. However, after some longer inactivity (several hours), the problem of slow delivery resumes.
I updated Google Play Services to 10.2.1, I tried to use it GoogleApiClient.reconnect()for every action, I deleted all streams from connection listeners - no help. Even restarting both the watch and the phone does not pull out a couple of locked communication states.
From viewing the logs, it seems that one side is sending a message, the other simply does not receive it. Instead, the sender receives its own data message.
Since the message is bidirectional and messages can appear at any time, I need to maintain a constant connection. The sender tries to connect before sending the message, and the onConnectedlistener is called , but the message is not delivered immediately.
Is immediate reporting required in addition to calling the setUrgent method? What is the magic of the Android Wear app that does this, not only does it have no communication problems, and even with the help of my “forgotten” messages?
If you need more information for diagnostics, let me know how to debug.