Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Obtaining Location using GPS

 
Sunni srivastav
Greenhorn
Posts: 24
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic