1

Good day, I really hope someone can help me with this. I'm having difficulties trying to sync data between 2 devices. Google Cloud messaging seems like the thing I want to use, and I've played with the tutorial. However I had the following questions:

  • I'm broadcasting commands to all users.. How do I send messages to a specific user?
  • How do I send data back to the webserver?
  • Is this the correct way of syncing data between multiple devices using the same google account?

The data will really be a small amount, so I do not need a massive server to accomplish it, and the 4KB limit on GCM will be more than enough.

PS I'm using Android studio.

Thanks for the help

4

1 回答 1

0

我正在向所有用户广播命令。如何向特定用户发送消息?

每个设备都有特定的注册 ID。您可以指定特定的注册 ID 并要求 Google 发送推送。请参阅服务器示例。

如何将数据发送回网络服务器?

如果您想将数据从设备发送到您的第 3 方服务器,您可以通过 HTTP 发送,也可以使用GCM 云连接服务器的设备到云功能

这是使用同一 Google 帐户在多台设备之间同步数据的正确方法吗?

我想你走的路,你可以完成你想要的。不过,我不知道有更好的选择。此外,如何在不同设备之间同步数据可能会有所帮助。

于 2013-09-10T17:37:39.410 回答