File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Problem in Obtaining Location using GPS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Problem in Obtaining Location using GPS" Watch "Problem in Obtaining Location using GPS" New topic
Author

Problem in Obtaining Location using GPS

Sunni srivastav
Greenhorn

Joined: Feb 15, 2011
Posts: 22

I want to find the location of an android phone using GPS.Currently I am developing using Eclipse IDE and its android plugin.
Came across code to do this GPS code

But when I am trying to execute it does not display the longitude and latitude even after setting it through Geo command as well through DDMS

The Code is as below:


On the emulator, it prints Provider not available which is I guess cause
here location is null...
Please help in fixing this...
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

On the emulator, it prints Provider not available

The emulator doesn't have GPS. You have to run the code on an actual device that has GPS capability.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in Obtaining Location using GPS