Wrox Programmer Forums
|
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 4th, 2010, 08:49 PM
Registered User
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Where Am I: geocode IOException

Hi,

I am reading the example "Where Am I?" and I copied/pasted most of the code into my own app. When I ran it on the emulator, it worked perfectly while I got

java.io.IOException: Unable to parse response from server

when running it on my Nexus One phone.

The only difference between the example on the book and mine is I am using a second activity as a Dialog on top of the Map view. When the user clicks a button on the map view, the dialog pops up and the reverse geocode starts running. I tried to do the reverse geocode both in the main UI and as an AsyncTask but the results are the same: no error on emulator and always got IOExceptions on the device.

My next attempt would be to use a Service to do the reverse geocode to see if it goes through. Any lead would be appreciated!

Some updates:
I just ran the example from the book (Chapter 8 Where Am I 5) on both the emulator and my phone:
1. Emulator: Throws out NullPointerException/ViewRoot.draw(boolean) line 1374
2. Nexus One: Runs ok but gets the same IOException error as from my own app.

Thanks!

smallbug

Last edited by smallbug; April 4th, 2010 at 09:07 PM..
 
Old April 5th, 2010, 08:27 PM
Registered User
 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Just to report back. Doing the reverse geocode lookup in a background thread seems to solve the timeout issue!

Have a good one!









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