1. Are you ready for the Galaxy S20? Here is everything we know so far!

Phone goes to sleep and freezes terminal execution

Discussion in 'Android Development' started by regressist, Nov 29, 2021.

  1. regressist

    regressist Newbie
    Thread Starter

    Hi all,
    I wrote a program which runs in Terminal on my phone (Android 9), this program makes some computations and writes the result in a file. No input, no app.
    I have realized that after a few minutes I suspend the display the execution is frozen and resumes when I switch it on again, very annoying since my goal is to take advantage of the CPU during day and night.
    Is there any way to avoid this? Note the phone is not rooted
    Thanks a lot in advance to whomever will reply
     



    1. Download the Forums for Android™ app!


      Download

       
  2. codesplice

    codesplice Elite Recognized Moderator
    Moderator

  3. regressist

    regressist Newbie
    Thread Starter

    Thank you for your reply,

    this is beyond my capability, I am not a programmer, my program is written in (old) Pascal. And anyway this wakelock should be included in Terminal, right? I mean even if I was able to do it, I can not put it inside the program running in Terminal... should be the Terminal itself implementing the lock.
    Am I wrong?
     
  4. codesplice

    codesplice Elite Recognized Moderator
    Moderator

    Yes, it would be up to the terminal emulator app you're using to implement the wakelock. I know some have a toggle in the settings for that.
     
  5. regressist

    regressist Newbie
    Thread Starter

    codesplice likes this.
  6. codesplice

    codesplice Elite Recognized Moderator
    Moderator

    That should do the trick! :thumbsupdroid:
     
  7. regressist

    regressist Newbie
    Thread Starter

    Congratulations!!! Thanks

    UPDATE: no it does not seem to work, after 10 minutes still at the beginning...
     
    #7 regressist, Nov 29, 2021
    Last edited: Nov 29, 2021
  8. regressist

    regressist Newbie
    Thread Starter

    No, does not seem to work...after 10 minutes it was still at the beginning
     
  9. codesplice

    codesplice Elite Recognized Moderator
    Moderator

    Shoot, I really thought that would do the trick. I'm afraid I don't know what else to try though.
     
  10. regressist

    regressist Newbie
    Thread Starter

    Yes, I think you are right, more than that, there is the option but does not work. Thanks a lot anyway
     
  11. regressist

    regressist Newbie
    Thread Starter

    Maybe it is working now with the following steps: I opened the terminal and set wakelock on, then I opened a new window inside Terminal and killed the old one, then I worked on the second. I should have launched during the night a counter to be sure but since I am in a hurry I launched my program and I have the feeling it works because I had some results in the morning, even though not mathematically sure, afterwords I will check the counter
     
    codesplice likes this.
Loading...
Similar Threads - Phone goes sleep
  1. Brincanareia
    Replies:
    0
    Views:
    240
  2. Artisean
    Replies:
    1
    Views:
    267
  3. Mermun208
    Replies:
    5
    Views:
    428
  4. J Carver989899
    Replies:
    1
    Views:
    342
  5. unaflores21
    Replies:
    4
    Views:
    521
  6. jraju
    Replies:
    9
    Views:
    550
  7. Nomad of Norad
    Replies:
    1
    Views:
    573
  8. seanof30306
    Replies:
    3
    Views:
    566
  9. GingerOverlord
    Replies:
    8
    Views:
    1,173
  10. SteliosLkop
    Replies:
    16
    Views:
    3,202

Share This Page

Loading...