Gps Tracking

Shameem

Member
Licensed User
Longtime User
Hi

I trying to the GPS Tracking App.

I am taking GPS coordinates and upload to my server. Its all works fine upto the device sleeps, Is there any option to get GPS coordinates upload continously without break in sleep , Anybody please help me

Thanks and Regards

Shameem H

:sign0163:
 

BlueVision

Active Member
Licensed User
Longtime User
Had a similiar problem, you have two options.

Option 1:

Add this to process Globals:
Dim PWS as PhoneWakeState 'Variable for Phonewakestate

Add this somewhere into the code, preferred at ActivityStart:
PWS.KeepAlive (False) 'Enabling Wakelock with dimmed display

Add this to Activity_Pause:
PWS.ReleaseKeepAlive 'Disabling Wakelock when APP finishes

Option 2:

Try it with a service in background, preferred StartServiceAt. This will run independent from your app.

I tryed in my program the first option, but it will drain your phone's batterys visibly, simply because of the dimmed (but still lighted!) display. GPS-hardware is giving an additional huge load to powerconsumption...

I am a newbie too, I tryed to implement a service for that kind of GPS-thing since days. I believe, I figured out now how to do. So it's your choice. Option 1 is ok, depending on your phones batterystate. But keep in mind, that every phonecall you get, every case interrupting your program in foreground will pause it (stop it, and give the system the chance for killing the APP). The second option runs as long as you don't stop it or the system will kill the service.

Cheers from Berlin
BV
 
Upvote 0

Shameem

Member
Licensed User
Longtime User
Gps

Hi Erel

Thanks for the Prompt Reply , But I would like to know whether the partial lock turn screen off .
 
Upvote 0

Shameem

Member
Licensed User
Longtime User
Had a similiar problem, you have two options.

Option 1:

Add this to process Globals:
Dim PWS as PhoneWakeState 'Variable for Phonewakestate

Add this somewhere into the code, preferred at ActivityStart:
PWS.KeepAlive (False) 'Enabling Wakelock with dimmed display

Add this to Activity_Pause:
PWS.ReleaseKeepAlive 'Disabling Wakelock when APP finishes

Option 2:

Try it with a service in background, preferred StartServiceAt. This will run independent from your app.

I tryed in my program the first option, but it will drain your phone's batterys visibly, simply because of the dimmed (but still lighted!) display. GPS-hardware is giving an additional huge load to powerconsumption...

I am a newbie too, I tryed to implement a service for that kind of GPS-thing since days. I believe, I figured out now how to do. So it's your choice. Option 1 is ok, depending on your phones batterystate. But keep in mind, that every phonecall you get, every case interrupting your program in foreground will pause it (stop it, and give the system the chance for killing the APP). The second option runs as long as you don't stop it or the system will kill the service.

Cheers from Berlin
BV

Hi

Thanks for the options

I am using Startservice at , Service starts correctly but due to network failure in sleep mode it doesn't uploads the Coordinates

Regards
Shameem H
 
Upvote 0
Top