Click here to Skip to main content
15,909,039 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Greetings,

I'm working on an app that will tell me how long a vehicle has been driving and standing still based on GPS info on and android device.

So far for reading the GPS I have not been able to find an eventhandler that will let me read the GPS while standing still

When using the LocationManager.RequestLocationUpdates in Android, I can use the OnLocationChanged to time the driving time, but I need to start a new timer when parked up, and new info on the screen...

Everywhere I've looked for info (Yes, googled) I get referred back to OnLocationchanged. I need something like that, but then OnSameLocation

I could set 0 seconds and 0 distance when using RequestLocationUpdates (didn't try, but it should always call OnLocationChanged as the update distance is 0), but I'm just wondering If there is another way of doing this

Any help please??

thanks,


BBB
Posted
Updated 25-Oct-12 6:40am
v2
Comments
Ravi Bhavnani 25-Oct-12 15:03pm    
I think you'll need to call getGpsStatus(null) every n units of time after the last call to onGpsStatusChanged(), but you probably figured that out.
BBBwex 25-Oct-12 15:11pm    
GpsStatus refers to the status of the GPS engine and not with the actual location fix. but thanks.

Think I'm going with the location updates set for 0. as I write this my phone is lying beside me and even now the GPS coordinates keep changings so I can use that by looking only at 4 digits after the decimal point

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900