Timeout testing for GPS Signal using ESLocation2 Library

Azhar

Active Member
Licensed User
Longtime User
Hi

Using the new ESLocation2 library uploaded by Iagore, is there a way where one can test if it is taking too long trying to get a GPS Fix?

I have configured the GPS Listener to attempt a GPS Fix once every 30 minutes but my problem is that if the phone/device is not in view of sky, the device continuously tries to search for a GPS Satellite signal which drains the battery power.

I can't test if the LocationChanged event has not fired since I can't really tell what time the search for GPS function started. Is there a way of probing if the GPS state is stuck in 'searching for GPS Signal' mode?b I would only like it to search for a GPS Signal for a maximum of 30 seconds.

Regards,

Azhar
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
Gps

Hi

We have implemented this in one our our apps, you will need to use a timer. You can always set a future timout date -

DIM GPS_TIMEOUT as long

Set this using;

GPS_TIMEOUT = DateTime.Add(DateTime.Now + (DateTime.TicksPerMinute * [your timeout value]),0,0,0)

Have a play with this, you may also need a flag to tell yourself to turn off the GPS, it really depends on how you have structured your app.

J.:cool:
 
Upvote 0
Top