电池的寿命,如果使用GPS和后台应用的iOS / Android版 [英] Battery life if using GPS and background app ios/android

查看:217
本文介绍了电池的寿命,如果使用GPS和后台应用的iOS / Android版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人已经创建了在后台启动,并利用GPS来收集当前的纬度和长每分钟左右的应用程序?如果有,请你提供你的电池时间?正如,多久你的电话一直持续到所有的出汁从刚刚运行与标准的手机程序,后台程序。

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.

我想看看它是否将是值得的时间来创建一个应用程序为我自己,但如果我8小时工作,不要有那段时间充电我的电话的方式,然后我不希望被回家和它关闭在我身上,因为我的应用程序,我会在​​我家进行创作。我需要的应用程序来工作,因为它会看到当我在我家(来自GPS)的范围,然后在房子从我的手机发送指令到我的服务器。所以,这就是为什么它需要能够留在后台做了检查每隔1分钟左右。

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.

还是只有打开GPS(这是可行的与iOS和放大器;或Android)?!?其时下午5:00,每天如此,这将最大限度地减少对电池的负荷后

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!

推荐答案

看起来我们的工作同样的要求。我的code发送GPS位置服务器上定期间隔(比如1分钟,5分钟,15分钟......根据用户要求)uptil现在我的code是喜欢它不断开启GPS使电池的寿命是非常几个小时像3-4小时(设备/手机充满电)。

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 ) uptil 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 ).

在Stack Overflow上搜索后,我来到这个回答。现在要解决电池问题在GPS启动时,应用程序要上传的数据,并在30秒内停止这样我又重新设计应用程序。

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.

此外,我从TimerTask的类改变code到AlarmManger类,因此用户少得多的内存。

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

这些改变之后,我的应用程序工作1分钟的时间间隔(当手机充满电)等10小时。

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

一般情况下电池续航时间为20小时,无间隔的设置方式,它​​可以延长该期限,所以我就喜欢2分钟最佳水平。

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?!?

我建议你看看 AlarmManager 类的例子。这将是您最佳的解决方案。您的应用程序将是非常轻的重量。

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

这篇关于电池的寿命,如果使用GPS和后台应用的iOS / Android版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆