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 March 8th, 2010, 12:18 PM
Registered User
 
Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 8 Where Am I

When I run the project "Chapter 8 Where Am I" (downloaded code from www.wrox.com) on Eclipse, it says "No Location found". When I tried sending the co-ordinates from the Emulator console -> Location Controls -> Manual, the button "Send" is not responsive. I also loaded a KML file, but it didn't work either. The application says "No location found". How do I see the Lat and Long co-ordinates on the emulator?
 
Old March 9th, 2010, 09:31 AM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Interesting. The first 'Where Am I?' project example only checks for the current location once. In order for the location controls to work, you need to have at least one application that has requested regular updates.

I'd suggest trying one of the later 'Where Am I?' examples from further into the chapter that requests updates (pp 253) and see if that helps.
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
 
Old March 9th, 2010, 01:27 PM
Registered User
 
Join Date: Mar 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Reto,
Thanks for your quick reply. The final version of the application "Where am I" finally worked, when tried on an actual device instead of emulator. Emulators are working very strange for this particular application. Now the emulator says "The application has stopped unexpectedly. Please try again." I will keep testing on the actual device.

-Manoj
 
Old July 29th, 2010, 08:41 AM
Authorized User
 
Join Date: Jul 2010
Posts: 15
Thanks: 2
Thanked 0 Times in 0 Posts
Default Chapter 8 Where Am I not returning Address

I ran the Where Am I 2 version in Chapter 8. It was supposed to reverse Geocode the address from the lat/log coordinate location, however it is not returning the address. The DDMS indicated the following message:

07-29 08:05:31.131: DEBUG/SntpClient(83): request time failed: java.net.SocketException: Address family not supported by protocol

What can I do to get this to run and return the address as indicated in the example?
 
Old January 28th, 2011, 03:21 AM
Banned
 
Join Date: Jan 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also had the Send button problem and the "No location found" problem. It finally worked with these steps:

1. Add the following code before updateWithNewLocation() call.

Code:
   locationManager.requestLocationUpdates(provider, 2000, 10,
         new LocationListener() {
            @Override
            public void onLocationChanged(Location location) {
            }
            @Override
            public void onProviderDisabled(String provider) {
            }
            @Override
            public void onProviderEnabled(String provider) {
            }
            @Override
            public void onStatusChanged(String provider, int status, Bundle extras) {
            }
         });
2. In DDMS, click the emulator-#### row inside of Devices window. This allowed me to click Send.
3. Scroll down inside of Emulator Control window, and click Send.
4. Start the WhereAmI app to see the Latitude and Longitude!

Yuji Yoshiie




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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