How to get current location in android ?

How to get current location in android ?



On 2014-06-10 05:25:44.0
hemanth


By Implementing Location Listener,you can override onLocationChanged() which will give current location.


On 2014-06-10 06:01:41.0
subha064
Thanks for replaying, please give me some sample code, am not getting how to do.


On 2014-06-10 06:08:18.0
hemanth
public void onLocationChanged(Location loc){
//curent lat and lng
double curentlat=loc.getLattitude();
double currentlng=loc.getLongitude();
}
and required permisions in manifest file.


On 2014-06-10 06:13:15.0
subha064
By using  getMyLocation ()  .


On 2014-06-10 06:23:46.0
vinaykumar

copyright@questionsforum.net