4

I develop the Android watch/phone application pair, where watch and phone communicate using Data API.

I need to pass the messages immediately, or with few minutes delay at most (not 30 minutes). To achieve so, I call setUrgent() on my PutDataRequest.

For the reasons I do not understand, the message still takes very long time to deliver.

The message is delivered immediately if I try to play with the stock Android Wear app changing the watch face. Also, after the first message is delivered, others seem passing immediately. However, after some longer time of inactivity (few hours) the slow delivery problem resumes.

I have updated Google Play Services to 10.2.1, I tried to use GoogleApiClient.reconnect() on every action, I have removed all threading from the connectivity listeners - no help. Even rebooting both watch and phone does not pull out the pair of the stalled communication state.

From watching the logs, seems that one side sends the message, other just does not receive it. The sending side receives own data message instead.

As the communication is bidirectional, and messages may come at any time, I need to keep the connection permanent. The sender tries to connect before sending the message, and the onConnected listener is called, yet the message is not delivered immediately.

Is anything is required to deliver messages immediately, in addition to calling of the setUrgent method? Which kind of magic the Android Wear app does that not only it has no problems of communicating, and even pushes my "forgotten" messages through?

If you needs some additional information for diagnostics, please tell me how to debug.

Audrius Meškauskas
  • 20,936
  • 12
  • 75
  • 93
  • The preliminary reason for this the watch gets kinda "disconnected", and this state is visible and can be fixed in Android Wear app. It is still not clear how to connect it back programmatically or at least detect this disconnected state. – Audrius Meškauskas Apr 04 '17 at 07:07
  • 4
    Provide some code – Vyacheslav Apr 04 '17 at 09:40

0 Answers0