简体   繁体   中英

How to keep running my android app when phone goes standby?

Hi i'm programming an app that reads sensors values, and I need that it continue saving data while the phone goes standby (the screen go black after 1 minute). Any idea?

使您的代码在服务中

As P10 said Service is best.

And depending on how frequent you want to collect new data, a wake lock may be in order, to wake the phone from sleep. This of course can reduce battery saving sleep time so use wake locks sparingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM