Getting rss topics for arabic sites Dynamically - android

I want to create an android App that getting Arabic news by RSS Feeds.
I want to know if there are any way to dynamically get the Rss feeds and separate them according to its topics?
Thanks for Advance.

There are at least two ways of doing this.
The first way is to look for a source that provide you with different topics, here's an example of what I mean. With those different topics being treated as each individual news feed, you are able to display them separately.
The second way is to not directly display the feed using ListView. You should first, store the news feeds into somewhere for pre-processing, for instance, you can use SQLite. While storing each news, you include a new column for your desired 'grouping' for separation. After that, you can create an adapter that pull news from this source (or SQLite) and display them in your ListView.
Pardon me for only providing you with the concepts, as I don't have a sample code to show you. I hope you understand what I am trying to describe to you.

Related

Container for Android application : ListView

I have started Android development recently.
My ambition is to create an application which send an http request to get a list of posts.
For each post (in json), there is a name, a date and the content of the post.
I know how to parse a json file and how to fill objects.
I am curious about what kind of containers I should use. Is a ListView a nice choice?
It depends on the layout structure or some other details you need. I mean maybe your images are located in two or three columns or something like that. Otherwise of course you need to use ListView.
See this: http://developer.android.com/guide/topics/ui/declaring-layout.html#AdapterViews

Best way to display information to a ListFragment?

I am creating an app for my campus news paper and one of the features will be a tab with a list of all the clubs and organizations on campus. I am wondering what the best way to do this would be. I currently use an RSS handler to fetch new articles from the website in another tab, but the information on the clubs and organizations is not on an RSS feed anywhere.
I am wondering what the best way to put this information into a list would be? I initially thought the simplest way would be with a text file, or by xml file. Ideally I would like for the list item to show the club's short name and the full name under it, like I have the article name and pub date in the articles tab. Such as IEEE and under it Institute of Electrical and Electronic Engineers.
When a list item is clicked I want to launch a detail view with the clubs logo and a description. I would like to know if anyone has done something like this before and knows the best way to do this.
I think it would be possible to create my own XML file and parse it like I already did for the news articles, but I am not sure, any advice would be appreciated.
I decided to create my own XML file and read it from the assets folder, pretty much the same method I used for the RSS feed but with a different InputSource.

Is a listview with webview items appropriate for a news app?

I am building an app that scrapes a certain web site and presents the latest news in a listview, html formattted with an image, a title and a summary. When the user clicks on a row, the news article is showed. It works a bit like the CNet app and similar news apps.
I have no problems with the scraping part, but I am in doubt on how to manage the summary list.
My initial idea is to have a listview where each item is a webview. The listview is populated by a custom ArrayAdapter filled with the scraped html content. Each screen will show the summaries from the 30 most recent articles, ie. up to a month old.
Is this approach recommended or will 30 webviews take up too many system resources?
Would it actually be better to use on big webview, using simple html (ul) to show the summary list?
Also, is an array adaptor the right way to go, or would a cursor be better?
If there are completely different ways to do this, please let me know!
Thanks.
Webview is not a bad approach, but there are better ways. I'd suggest to show the text normally (I mean, in a TextView). I'd use WebView if you are going to show long HTML content that has a complex format or use CSS... but, what you want is showing a preview, so keep it simple. It will be also faster, and more maintainable if you do it in a TextView.
With regards to the adapter... it really depends on how are you persisting the data. If you are just fetching those feeds from internet, parsing them and showing them right away, then you have no choice but using an ArrayAdapter or something like that. On the other hand, if you are persisting your data into a Sqlite database, then CursorAdapter is much better.
Romain Guy, the developer on the Android team who is most vocal on the web helping developers actually said in one of his talks (which you can find on YouTube...not sure which one) that technically you "could" do that, but he'd be extremely upset with you if you did. lol
There is probably too much going on in a WebView to make this the ideal choice of ListView items. I would create a "model" object representing the data for each item that you're abstracting and just make an xml layout that you can populate in a custom adapter.
This video is GREAT info if you're working with ListView
http://www.youtube.com/watch?v=wDBM6wVEO70
I don't see why the application wouldn't be able to handle the 30 html feeds, so you should be good there.
A ListView should be fine to use. Obviously, this all depends on how you want the UI to look and feel.
Lastly, a cursor adapter is used when using a cursor from a db query. Unless you're storing the feeds in a local db, this doesn't seem to be what you're doing. So, the array adapter should work fine for you.

Android -- How to get complete article from the RSS feeds?

Well I am learning Android RSS Feeds parsing, and I have a question. Consider I am using Goal.com RSS feed and displaying on my Android phone.
Goal.com RSS Feed : http://www.goal.com/en-us/feeds/news?fmt=rss
But as you can see from the Rss feeds, they are only the headlines of the article containing 2 - 3 lines of the description. I was wondering is there any way I can get the complete article from it after parsing the feeds. Any pointers to guide me would be helpful . Thanks
Unfortunately, if the RSS feed doesn't contain the full article, there isn't an easy way to get it. You can look at the link tag for each item to find it on the web and then do some screen scraping, but that gets ugly fast.
#Clifton is correct. Even by this nature we can save our posts from autoposter plugins. Besides you can find the common pattern of your target web page where contents resides. You can etract that area of content programmatically.

Show feeds in android

I want to show feeds from a blog in a listview. It would be really help if you guys can suggest some tutorials or how to do it?
thanks in adv.
I can point you in the right direction, using standard Android SDK components.
Your solution will consist of several pieces - an HTTP downloader, an RSS parser (presumably the blogs have public RSS feeds), a ListAdaptor, and your ListView.
Firstly, you need to grab the RSS file from the blog. There are a bunch of ways to do this, I'd suggest using HttpClient and HttpGet.
Next, you'll need to parse the RSS file you downloaded. For this, you can use XMLReader. Writing a good RSS parser is probably the trickiest bit!
Now you've got your data parsed, store it in a list and write a ListAdaptor.
Hook the ListAdaptor upto your ListView using setAdaptor and you're good to go.
If this all sounds a bit complicated, there are various Java RSS libraries that'll perform steps 1 and 2 for you.
You may also want to take a look at the source code of android-rss, and give IBM's XML article a good read!

Categories

Resources