StealthRT
StealthRT

Reputation: 10542

Battery life if using GPS and background app ios/android

I was wondering if anyone has created an app that starts in the background and utilizes the GPS to gather the current Lat and Long every minute or so? If you have, would you please provide your battery times? As in, how long does your phone last until its all out of juice from just running that background app with standard cell phone programs.

I'm trying to see if it would be worth the time to create an app for myself but if i work for 8 hours and dont have a way of charging my phone during that time then i dont want to be going home and it shut down on me since my app i would create works at my house. I need the app to work since it will see when i am in range of my home (from the GPS) and then send commands to my server at the house from my phone. So thats why it would need to be able to stay in the background doing a check every 1 minute or so.

Or only turn on the GPS (Is this doable with iOS &or Android?) whenever its after 5pm each day so that it will minimize the load on the battery?!?

Any help or suggestions would be great! Thanks!

Upvotes: 1

Views: 2973

Answers (1)

Lucifer
Lucifer

Reputation: 29632

It looks like we worked on same requirement. My code sends GPS location to server on regular interval ( say 1 min, 5 min, 15 min... as per user requirement ) untill now my code was like it constantly open the GPS so battery life was very few hours like 3-4 hours ( when device/phone is full charged ).

After searching on Stack Overflow i come to this answer. Now to solve battery issue i again re-design the application in such a way that GPS start when application is going to upload the data and stops in 30 seconds.

Also I change code from TimerTask Class to AlarmManger class so it users much lesser memory.

After these changes my application works 10 hours for 1 min interval ( when phone is full charge ) and so on.

Normally battery life is 20 hours, and no interval is set like that it can extends that period, so i got optimum level like 2 minutes.

Or only turn on the GPS (Is this doable with iOS &or Android?) whenever its after 5pm each day so that it will minimize the load on the battery?!?

I suggest you to look AlarmManager class's example. It would be the best solution for you. your application will be very light weighted.

Upvotes: 5

Related Questions