Wrox Programmer Forums
|
BOOK: Java Programming 24-Hour Trainer by Yakov Fain
This is the forum to discuss the Wrox book Java Programming 24-Hour Trainer by Yakov Fain; ISBN: 978-0-470-88964-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Java Programming 24-Hour Trainer by Yakov Fain section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 28th, 2012, 02:58 AM
Authorized User
 
Join Date: Feb 2012
Posts: 30
Thanks: 5
Thanked 4 Times in 4 Posts
Default Lesson 21 Try It

Instead of reading files, I displayed the entries from two RSS feeds to the left and right text areas respectively, using the following doInBackground() method:

Code:
	@Override public String doInBackground(){
		
		StringBuilder result = new StringBuilder();
		SyndFeedInput feedInput;
		feedInput = new SyndFeedInput();

		SyndFeed feed = null;

	    try {
	           feed = feedInput.build(new InputSource(feedURL));
	        }	 
		catch (Exception e) {
	           e.printStackTrace();
		}
 		
		List<SyndEntry> entryList = feed.getEntries();
		
		for (int i = 0; i < entryList.size(); i++) {	        
	             result.append("Title: " + 
                                (entryList.get(i)).getTitle() + 
                                 "\n" +
		    		"Link: " + 
                                 (entryList.get(i)).getLink() +
		    		"\n" + 
		    		"\n");
	    }
		
		return result.toString();
	   
	}
I'm wondering how to do to have the application look for updates and display the new items in the text areas as soon as they are distributed.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ex 21-3 SimpleEdit modification zavodney BOOK: Stephens' Visual Basic Programming 24-Hour Trainer 2 September 1st, 2011 08:24 PM
? p. 21 wrogers814 BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 2 September 9th, 2009 10:01 AM
list_entry(), page 21 logicman112 BOOK: Professional Linux Kernel Architecture ISBN: 978-0-470-34343-2 1 March 19th, 2009 03:56 AM
Over 21 calculator - project PetraMan Javascript How-To 1 March 29th, 2005 09:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.