I have a program that gives messages based on your location. But this requires to have you GPS on all the time. Now I am thinking when a user stays long on the same spot it is really not needed that the GPS is on? But how do I know he is moving again?
the GPS library probably has a locationchanged event to prevent code being run all the time when not needed butI guess it will rely on the gps coords even when not moving.
Maybe you can use the accelerometer to detect movement and to enable the gps?
How accurate does the position have to be? if you only need a general location you can use the cell tower position this is probably accurate to 500 meters in a city and a couple of Km in the country.otherwise can you not switch on and off the GPS when required. Using the location provider with Wi-Fi turned on can give some very accurate results in urban areas.
If you only need to determine that the user is moving, consider using a service that runs every couple of minutes and executes a simple pedometer routine to detect that the user is moving. The service can then toggle the GPS receiver on.
The service will also have to wake the phone if it shuts down the accelerometer when it goes to sleep.
How accurate does the position have to be? if you only need a general location you can use the cell tower position this is probably accurate to 500 meters in a city and a couple of Km in the country.otherwise can you not switch on and off the GPS when required. Using the location provider with Wi-Fi turned on can give some very accurate results in urban areas.