开发者

How to check updates on a website from an app?

开发者 https://www.devze.com 2023-01-09 11:11 出处:网络
I have a Website, which is built upon a CMS, written in PHP. And now I\'m trying to develop an App. I want the app to check for Updates on the website every time it starts, for example, if a new artic

I have a Website, which is built upon a CMS, written in PHP. And now I'm trying to develop an App. I want the app to check for Updates on the website every time it starts, for example, if a new article is added to the website, a news about this publishment should be displayed on the app.

My knowledge in this area is very poor. Can somebody tell me, what I should do on the we开发者_JAVA技巧bsite and what should be done on the app?


1) You can check the database of your CMS for recent updates via a web service (as you cannot use mysql remotely/directly from Android; assuming your CMS DB is a mysql db). This would mean that your CMS / you must provide a web services API for such function.

2) Or you could provide RSS feeds from your CMS and retrieve the RSS feed via http request and parse it. Maybe the RSS approach is simpler, a java RSS parser if for example as used in http://www.ibm.com/developerworks/opensource/library/x-android/index.html#resources or http://code.google.com/p/android-rss/

Many CMS have RSS function built-in already by default. Which CMS are you using? Here's also an article how to parse rss (xml) feeds from i.e. a website: http://www.ibm.com/developerworks/opensource/library/x-android/index.html

(Edited reply: correction, Rome lib doesn't work on Android. Corrected lib and url above.)


If your website provides an RSS feed, you can build a notification App for that website quicky using the BuzzBox SDK. It has an Rss Reader already integrated and will create a notification when something new is found in the feed. You can run the Rss Reader task when your App starts, and with the buzzbox scheduler you can also make your app check for updates in the background. More info here: http://hub.buzzbox.com/android-sdk/ and an rss example here: http://hub.buzzbox.com/android-sdk/demoapp

0

精彩评论

暂无评论...
验证码 换一张
取 消