# How to continue running while Android screen is locked

**URL:** <https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049>\
**Category:** Processing for Android\
**Created:** [December 7, 2022, 11:10am UTC](https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049 "2022-12-07T11:10:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigboss97](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Post date:** [December 7, 2022, 11:10am UTC](https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049/1 "2022-12-07T11:10:19Z")

</div>

I’m using _draw()_ loop to send repetitively HTTP requests. Everything works fine. But as soon as the phone times out and goes into lock mode. The draw loop is no longer running.  
What should I use in order to keep my sketch running while screen is locked?

---

<div class="post-metadata">

**Author:** ![bigboss97](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bigboss97](https://discourse.processing.org/u/bigboss97)\
**Post date:** [December 8, 2022, 4:41am UTC](https://discourse.processing.org/t/how-to-continue-running-while-android-screen-is-locked/40049/2 "2022-12-08T04:41:04Z")

</div>

Just tried it with _tread()_ that seems to do the job.  
But since I’m new in this I also love to hear other suggestions.
