[android-developers] Problem with Finding with Geo Coordinates

2009-12-03 Thread RS.Giridaran
Hi All,

I am developing an application which uses the current location of the
user to do some operations. i have used LocationManager and
LocationListener to receive the latitude and longitude values in
onLocationChanged() method. it is perfectly working when i am testing
using emulator control in eclipse. when its accessing from the real
device its not functioning properly. its will give 0, 0 for latitude
ad longitude.

Here is my code which used to get the current location.
/*Code*/
public GeoLocationManger(Activity activity) {
LocationManager locationManager = (LocationManager) activity
.getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
List providers = locationManager.getProviders(criteria,true);
if(providers != null  providers.size() 0){
LocationProvider pro 
=locationManager.getProvider(providers.get
(0).toString());
locationManager.requestLocationUpdates(pro.getName(), 
0, 0, this);
}
else
{
Messages.displayMessageOnUI(GasBuddyConstants.INFO,
GPS Not Enabled – Update your 
settings.,
activity);
}
}


public void onLocationChanged(Location location) {
this.latitude = location.getLatitude();
this.longitude = location.getLongitude();

}

/*Code*/


is there any settings need to do with phone?

Please help me to resolve this.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem with Finding with Geo Coordinates

2009-06-17 Thread RS.Giridaran

Hi All,

i want to find the latitude and longitude of the current location for
that i have followed as per the link below

http://groups.google.com/group/android-developers/browse_thread/thread/2500ad71054ec64/885bbb7e6362b760?lnk=gstq=finding+geo+locations+using+intents#885bbb7e6362b760

But now i am using android sdk 1.5 r2, it does not contain the methods
specified in above link.

Please help me to get the geo coordinates.

Thanks ,
Giri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---