Questions tagged [sleep-mode]

A power-saving condition of a computer or mobile device where it appears it is not on; the screen is not on and typically no sound is output. The computer's state is maintained in RAM.

Use this tag to identify questions related to checking on whether a device is in sleep mode, what capabilities are available in that mode, and how to "wake up" the device if appropriate.

206 questions
8
votes
3 answers

Android AlarmManager not working while phone asleep

I've got a problem with AlarmManager. In short, I plan an alarmManager : Intent intent = new Intent(context, MyActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); AlarmManager alarmManager =…
mcourpot
  • 315
  • 1
  • 4
  • 15
8
votes
4 answers

Would a scheduled Java app run when Windows is in sleep mode?

If I start a Java app, it initiates and does some work then goes to thread sleep for an hour, then wake up after an hour and does some more work ... But my PC is running Win7 and after 15 minutes of inactivity, it will go into sleep mode, so my…
Frank
  • 30,590
  • 58
  • 161
  • 244
7
votes
3 answers

prevent mobile from going into sleep mode when app is running

I want to prevent Android Mobile from going into sleep mode when my threads are sending HTTP request. as what happened while threads are doing HTTP calls mobiles goes to sleep mode and when user wakes up the phone threads never complete. User has to…
AZ_
  • 21,688
  • 25
  • 143
  • 191
7
votes
2 answers

Make node.js program prevent the system from entering sleep mode

I am wondering if it is possible for a node.js program/script to prevent the operating system (windows) from entering in sleep or hibernate mode?
Franck Freiburger
  • 26,310
  • 20
  • 70
  • 95
7
votes
2 answers

Configuring iOS VoIP application to run in sleep/background mode

I am developing a VoIP based iOS (7.1) application. It's underlying socket programming is written in C++ rather than objective C. The app runs fine in foreground but while putting in sleep/background mode it can't receive any communication from…
Vinay Podili
  • 335
  • 1
  • 3
  • 16
7
votes
3 answers

Turn on the Internet on Android when in sleep

I have an Android app that needs to sync to the internet, but as soon as the phone goes to sleep I can't access the internet. It only happens when the user uses the "battery mode", when it turns off the data after 15 minutes. I wrote a test app and…
programmersbook
  • 3,914
  • 1
  • 20
  • 13
6
votes
5 answers

Can't catch sleep/suspend messages (winXP)

My app needs to block sleep/hibernate mode. I have the code in place, but after successfully catching the WM_POWERBROADCAST message, neither PBT_APMQUERYSUSPEND nor PBT_APMQUERYSTANDBY are being caught successfully. Interestingly, the…
Garrett
  • 1,750
  • 2
  • 16
  • 23
6
votes
1 answer

How can I prevent idle sleep in a long-running bash script on Mac OS?

I have a bash script that executes several long-running commands on Mac OS. How can I prevent the computer from going to sleep while the script is running?
augurar
  • 12,081
  • 6
  • 50
  • 65
6
votes
1 answer

Avoid VS Code Remote having to reload window after Mac goes to sleep

When connected to a remote SSH host and my Mac goes to sleep after a few minutes of inactivity, I have to reload the whole window to re-establish a connection when I return. What's the least energy-inefficient way of avoiding this wait-time…
Janosh
  • 3,392
  • 2
  • 27
  • 35
6
votes
2 answers

Windows sleeps while running a long C++ Visual Studio program

I am using Windows 8.1, Visual Studio 2013 and I have a C++ project which runs over 15 minutes. But the problem is the windows gets into sleep while my is still debugging. I know this is occured because the sleep wait time is exceeded while running…
6
votes
2 answers

How can I prevent Windows OS from entering Sleep mode - .Net

Using C#, how can I prevent Windows OS from entering Sleep mode? I know, that I can turn Sleep Mode off, that is what I do now. This question is about preventing the OS from Sleeping while a program is in a long running operation. Afterwards,…
citykid
  • 9,916
  • 10
  • 55
  • 91
5
votes
4 answers

How to initiate standby/sleep from command-line?

I have found a lot of info about how to shut down computer, put it in hibernation etc via the command line, however, any tips i have read about getting it to sleep as it does from the start-menu has so far not worked properly. I would like a command…
Araho
  • 139
  • 1
  • 1
  • 5
5
votes
1 answer

setTimeout Vs. sleep mode

From what I understood in several SO answers, if a computer goes to sleep mode after a setTimeout has been called, the sleep period should be ignored. For example: t0: setTimeout(foo, 30000); t0+20s: computer enters sleep mode t0+40s: computer…
Rodolphe
  • 1,689
  • 1
  • 15
  • 32
5
votes
1 answer

How to prevent the app from going to sleep, in order to integrate a sleep mode for the music

I have a working music App, written in Swift. I wanted to integrate a sleep mode which could pause the music played after, say 10 minutes. I used perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval) for this task, it…
FredericP
  • 1,119
  • 1
  • 14
  • 27
5
votes
2 answers

How to programmatically bring a laptop into Sleep mode

What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode? Thanks for any pointers.
Renaud Bompuis
  • 16,596
  • 4
  • 56
  • 86
1
2
3
13 14