Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development 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 April 12th, 2010, 09:41 PM
Authorized User
 
Join Date: Mar 2010
Location: Baldwin Park, CA
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default chapter 5 Earthquake

Code:
String hostname = "";//"http://earthquake.usgs.gov";
String linkString = hostname + link.getAttribute("href");
Is the link.getAttribute("href") suppose to be returning http://earthquake.usgs.gov as part of the string? On the code I typed, it does return the hostname and the url looks like the following:

http://earthquake.usgs.govhttp://earthquake.usgs.gov/.......


The above code was used to eliminate the extra hostname string.

Last edited by EricTapia; April 12th, 2010 at 09:44 PM..
 
Old April 13th, 2010, 02:02 PM
Registered User
 
Join Date: Mar 2010
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I think the hostname string was there for parsing relative URL...if the linkstring already contains the hostname part, then you don't need it.
 
Old April 14th, 2010, 12:47 AM
Authorized User
 
Join Date: Mar 2010
Location: Baldwin Park, CA
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you. I figure it be a logic error on Reto's part.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Running Chapter 6 Earthquake clombardo BOOK: Professional Android 2 Application Development 26 June 28th, 2012 01:33 PM
Chap. 9 Earthquake app does not work. pgmr26 BOOK: Professional Android 2 Application Development 1 March 27th, 2010 08:14 AM
Chapter 8 Earthquake Notification woods620 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 1 December 23rd, 2009 09:57 AM
Chapter 6 Earthquake using Provider abowman BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 0 March 9th, 2009 05:19 PM
Chapter 6 Sample Earthquake 2 sunrain BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 January 31st, 2009 04:06 PM





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