how to send notifications from a website to an android app [closed]

[亡魂溺海] 提交于 2020-01-01 02:42:24

问题


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.


回答1:


For sending Notification to any android Device you can use two technology: 1) Push. 2) Pull.

For Push Technology you can use GCM(Google cloud messaging).

For Pull Technology you can make you application continuously keep on connecting to server and trying to fetch data if it is available from there.

Advantages of GCM:
1) Low battery comsumption. Since it will push the message to user device and it will push message when user gets connected to server.


For GCM you can use following Link for your reference:
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/C2DMSample



来源:https://stackoverflow.com/questions/13724007/how-to-send-notifications-from-a-website-to-an-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!