(solve)cant get getCurrentMethod() in LocationManager API...

Put your problem here if it does not fit any of the other categories.

(solve)cant get getCurrentMethod() in LocationManager API...

Postby rakesh_mehta » Mon Oct 20, 2008 11:33 am

Hello friends...

I am using SDK 1.0... I want to get the current location in my application.. so i have use the Location Manager...

But in Location Manager i cant get "getCurrentMethod()" ..

I have give the entry in AndroidManifest.xml also.. but still i hav same problem...

so Is there any way to find the current location...???

Waiting for your reply????
Last edited by rakesh_mehta on Wed Oct 22, 2008 7:26 am, edited 1 time in total.
Rakesh
User avatar
rakesh_mehta
Experienced Developer
Experienced Developer
 
Posts: 73
Joined: Tue Oct 14, 2008 6:46 am
Location: Ahmedabad(India)

Top

Postby MrSnowflake » Mon Oct 20, 2008 12:20 pm

Location manager doesn't have a getCurrentMethod().
http://code.google.com/android/reference/android/location/LocationManager.html

Location getLastKnownLocation(String provider) will give you the last know location.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby rakesh_mehta » Mon Oct 20, 2008 12:34 pm

Location getLastKnownLocation(String provider) will give you the last know location.

Thanks..

My application is look like this.. I want to get my current location.. so that whenever i start my application i have to show in map my current location (current Lat, Long..)... than after i have to show the notification message on when the the my application or user reaches his location...

getLastKnownLocation method give me the my lastknown location......

I hav review the example so they have used the GetCurrentMethod....

Anyways.. i try with getLastKnownLocation method...
Rakesh
User avatar
rakesh_mehta
Experienced Developer
Experienced Developer
 
Posts: 73
Joined: Tue Oct 14, 2008 6:46 am
Location: Ahmedabad(India)

Postby MrSnowflake » Mon Oct 20, 2008 12:38 pm

Don't really know if you need it, so it's just for info. For real-time motion tracking you should requestLocationUpdates() your own LocationListener.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby rakesh_mehta » Mon Oct 20, 2008 12:39 pm

Thanks :)
Rakesh
User avatar
rakesh_mehta
Experienced Developer
Experienced Developer
 
Posts: 73
Joined: Tue Oct 14, 2008 6:46 am
Location: Ahmedabad(India)

Postby rakesh_mehta » Mon Oct 20, 2008 2:54 pm

Finally i have solved the problem...

Perhaps GetCurrentMethod is no more in sdk 1.0

so i have used the Location class..

so that i can find the service providers's current Latitude and Longitude...
private Location loc;
Loc.getLatitude();
Loc.getLongitude();

So that i get the my service providers's current Latitude and Longitude... :)
Rakesh
User avatar
rakesh_mehta
Experienced Developer
Experienced Developer
 
Posts: 73
Joined: Tue Oct 14, 2008 6:46 am
Location: Ahmedabad(India)

Top

get current location

Postby dhaiwat » Thu Mar 12, 2009 11:47 am

hello Rakesh

i am novise for android in my appliction i want current lat and log what i do...

and what string name use as Service Provider?

plz solve my query
dhaiwat
Developer
Developer
 
Posts: 28
Joined: Tue Feb 10, 2009 6:49 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests