Android的PushNotification从Json的网址 [英] Android PushNotification From Json URL
问题描述
我有一个JSON的网址,其中包含有关数据的最新工作信息,我成功地解析JSON的网址,并能够在我的ListView显示顶层招聘信息。
I have a Json URL, which contains data about Latest Job Postings, I am successfully parsing the Json URL and able to display the top job postings in my ListView.
但我的要求是创建一个推送通知,所以,每当有新工作发布时,用户应该能够获取设备的通知。
But my requirement is to create a push notification, so that whenever a new job is posted, the user should be able to get a notification on device.
我按照这个: http://www.vogella.com/articles/AndroidNotifications /article.html
但我不知道如何让我的情况的通知。
But I don't know how to get notifications in my case.
谁能帮助我?
推荐答案
问题:
给推送通知用户的设备有关更新的数据,即使应用程序在后台模式。
Give push notification to user's device about the updated data even when application is in background mode.
解决方案:
当成功数据库中的新数据(这是要给更新的一组数据,以你的JSON请求),只需拨打其中发送GCM推送通知到所有用户的文件。插入
Upon successful insertion of new data in your database (which is going to give updated set of data to your JSON request) , just call the file which send GCM push notification to all your users.
参考:
<一个href=\"http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/\"相对=nofollow>使用PHP服务器GCM推送通知
在第二环节的演示程序psented执行$ P $的背景下,
In context of implementation presented in demo app of 2nd link,
,你可以叫 send_message.php
文件,但要确保 $ REGID
和 $消息
应该从数据库中检索
upon successful insertion,you can call send_message.php
file,but make sure that $regId
and $message
should be retrieved from your database
这篇关于Android的PushNotification从Json的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!