如何运行的连续过程过程

由网友(红桃王后)分享简介:我工作的一个Android应用程序中,我们在我们的实验室运行实验中使用。该应用程序监控使用加速度计的用户的运动,在定期间隔执行这一数据计算,并将结果写入文件。I'm working on an Android app to be used in an experiment we are running in our...

我工作的一个Android应用程序中,我们在我们的实验室运行实验中使用。该应用程序监控使用加速度计的用户的运动,在定期间隔执行这一数据计算,并将结果写入文件。

I'm working on an Android app to be used in an experiment we are running in our lab. The application monitors the users movement using the accelerometers, performs calculations on this data at a regular interval, and writes the results to a file.

我目前有一个非常困难的时期试图找到一种方式来运行这个过程15-20分钟,我们的试验要求没有它被杀害。尽管声明应用执着,尝试各种方式的服务(startForeground(),START_STICKY,..),等等......我似乎无法从决定暂停或终止我的服务/进程保持Android操作系统。

I'm currently having a very difficult time trying to find a way to run this process for the 15-20 minutes our trials require without it being killed. Despite declaring applications persistent, trying various service approaches (startForeground(), START_STICKY, ..), etc... I cannot seem to keep the Android OS from deciding to pause or kill my service/process.

我做了一些研究,我能找到的唯一的建议就是如何建立你的进程在被杀死恢复,但是我不能在我的数据差距,因此需要这个过程持续运行。

I've done some research and the only advice I can find is how to set up your processes to gracefully recover from being killed, however I cannot afford to have gaps in my data and therefore need this process to run continuously.

有人能指出我在正确的方向?

Could someone point me in the right direction?

推荐答案

我可以拿出我的问题是增加了器件到30分钟在屏幕睡眠延迟和祈祷没有任何按键被$ P $期间pssed的最佳解决方案我们的试验。

The best solution I could come up with for my problem is increasing the screen sleep delay on the device to 30 minutes and pray no buttons were pressed during our trials.

阅读全文

相关推荐

最新文章