10

I have made a website in html using a bit of javascript and php. I have made an android application using eclipse and java. what code or software or technique do i need to employ to allow my website to send notifications to my applications. And eventually send notifications from my app back to my website.

the aim one day is to send notifications from my website to a specific app on a specific android device.

Please answer my question or provide links to a solution. and excuse my ignorance as i am new to this.

4

1 回答 1

6

要向任何 android 设备发送通知,您可以使用两种技术:1) 推送。2)拉。

对于推送技术,您可以使用 GCM(Google 云消息传递)。

对于拉取技术,您可以使您的应用程序不断地连接到服务器并尝试从那里获取数据。

GCM 的优点:
1)电池消耗低。因为它将消息推送到用户设备,并且当用户连接到服务器时它会推送消息。


对于 GCM,您可以使用以下链接作为参考:
1) http://developer.android.com/google/gcm/gs.html
2) http://www.techrepublic.com/blog/app-builder/implementing- googles-cloud-to-device-messaging/428
3) http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html
4) https://github.com/teleknEsis/TechRepublic-Samples/tree/master/ C2DMS示例

于 2012-12-05T13:24:58.200 回答