andriy
andriy

Reputation: 4164

What is the better way to develop RSS reader for Android bassed on HTTP requests?

I'm new in development of applications for Android so I'm asking those questions for know which is better way to make RSS reader app. I have a server that downloads and stores on database news from Yahoo. On this database are stored title, content, publication date and link of news. Than I'm making HTTP POST to server to download news to Android. Data from server to android are passed in Json.

Can people, who already had developed an application like this, answer my questions?

  1. Should I pass all list of news in one response to POST or it's better to make it's better to make several POSTs to get the same list? I'm asking this question because response from server may be too big and I don't know which is a better way to transmit it.

  2. Comment system is the feature of my app. So need I to create a authentication system or it's possible to make it basing on ID of phone?

  3. Another thing I need to do is to alert user when new news has appeared on server. I don't have idea how to do it with HTTP POST? Need I send to server list of nees that I have on Android?

Thank you for attention.

Upvotes: 3

Views: 338

Answers (3)

Konstantin Pribluda
Konstantin Pribluda

Reputation: 12367

  1. POST vs GET - POST is meant to change state of server, whole GET is for reading results - you should use GET to retrieve news, and POST to post comments

  2. Use timastamp to retrieve news from some moment, update timestamp on the device with latest received news timestamp - this will save traffic for your users and your server. First update will get everything ( you may also put a limiton amopunt of news retrieved in single batch )

  3. everything based on something present on phone is not strong. however, you can use some kind of open id (there are a lot of providers, and most of your users will have google account) provider. In my highscore system I just hash incoming entries with some secret present in APK - this is not very secure, but data are not that valuable and there were no hack attepßts so far.

  4. Every push alert requires active polling from device - also your application shall ask via get request something like "are there new entries since last timestamp" ( but if you already do this, you may as well just download them ) - the alert user via usual android means ( widget, status bar, vibration, playing starwars imperial march... )

Upvotes: 0

Jatin
Jatin

Reputation: 31754

See it depends on how big your file is and more importantly how quickly do you need it. More requests will certainly increase the latency. What generally you should go for is for one request. But it again depends, I was once working on an android app and had the same problem. But in my case I split it into 2 requests. One so that I get initial data quickly and can disply to the user. Later with another request I can get the remaining data. So see wh1t suits you more.

Also how many requests will you have to make on an average in an hour. More polling will surely eat your battery a lot. If pushing can help you, try seeing if google's C2DM can be of any help.

For Rss parser ibm has an excellent link at http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/index.html

Upvotes: 0

Saurabh
Saurabh

Reputation: 7964

Here are the answers for your respective wuestions

1) This depends more on kind of UI you chose for your Android application. In my perspective you should go for multi-page (like prev-next links on bottom of screen) UI for your reader. And you should cache the results of previous page as well as next page in you app (so this also means to fetch selective results only) so that when user clicks on next/prev button the responsiveness of you application is good.

2) Ideally you app should ask for show a pop-up dialog asking to authenticate for commenting. You should use something like http://developer.android.com/reference/android/accounts/AccountManager.html to store these credentials so that from next time you do not ask the credentials again once authentication is successful.

3) In this case you should look at http://code.google.com/android/c2dm/ Polling is surely not the way to go :)

Upvotes: 3

Related Questions