How to convert a gps coardinate to lat/lng information

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

How to convert a gps coardinate to lat/lng information

Postby Jitendra Kumar » Sat Apr 19, 2008 10:17 am

Does anyone know how to convert a gps coardinate to lat/lng so that i can directly map to lat/lng by getting the gps value
Jitendra Kumar
Developer
Developer
 
Posts: 49
Joined: Thu Mar 06, 2008 7:55 am
Location: Bangalore

Top

Postby glock45 » Sun Apr 20, 2008 10:12 am

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  3.  
  4. Location location =  locationManager.getCurrentLocation("gps");
  5.  
  6. String tmp = "http://maps.google.com/maps?q="+Double.toString(location.getLatitude())+","+Double.toString(location.getLongitude());
  7.  
  8.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
glock45
Freshman
Freshman
 
Posts: 4
Joined: Sat Apr 19, 2008 11:21 pm

Re: How to convert a gps coardinate to lat/lng information

Postby smbogdan » Thu May 26, 2011 4:07 pm

Hello, could you tell me why when I try to write "getCurrentLocation" I get this error: "The method getCurrentLocation(String) is undefined ", I added the permissions and imported the location class.
smbogdan
Junior Developer
Junior Developer
 
Posts: 24
Joined: Thu Mar 10, 2011 4:52 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 4 guests