sleep-mode

How to use CPU to perform any operation in Deep Sleep mode

不打扰是莪最后的温柔 提交于 2019-11-27 09:51:47
I'm new in android . I struggle with my application approximately 3 weeks. I need sent and receive packets in normal mode and sleep mode . My app must exchange data a 5 seconds. I tried using alarmmanager but on android 5 it's not works. On android 5 an interval changes it on 60 seconds. Such a solution makes the battery wears out quickly. When I use normal asynctask, not IntentService , then it works only when screen is ON and app is visible. When app is hidden or I click power OFF then exchange data stops working. What is the best solutions? Even RTC_WAKEUP doesn't help most of the times.

Enable iPhone accelerometer while screen is locked

久未见 提交于 2019-11-27 06:02:30
问题 So apparently it is possible to keep the processor going processing stuff while the screen is locked, as indicated here: Running IPhone apps while in sleep mode However, after testing with the example code, UIAccelerometer will just stop giving value as soon as the device is locked pronto. Is there a way to force otherwise? 回答1: There was a bug in iPhone OS prior to 3.1.2 that caused the accelerometer to stop returning values as soon as the screen was blanked. You may be running into this

Is there a away to detect the event when iOS device goes to sleep mode (when the screen gets blackened)?

徘徊边缘 提交于 2019-11-27 03:40:50
I wanted to detect two events : Device gets locked/unlocked. Device goes to sleep and the screen blackens. First one I have been able to achieve here: Is there a way to check if the iOS device is locked/unlocked? Now I want to detect the second event, is there any way to do it ? Nate You basically already have the solution, which I'm guessing you found from one of my recent answers :) Use the com.apple.springboard.hasBlankedScreen event. There are multiple events that occur when the screen blanks, but this one should suffice: CFNotificationCenterAddObserver

Android - How can I wake up the phone from a hard sleep to take a picture?

十年热恋 提交于 2019-11-27 01:29:24
问题 I want to take pictures from the Android device's camera periodically over a matter of hours, to create a time lapse video effect. I set an Alarm Manager with an AlarmManager.RTC_WAKEUP flag set to start up a service every few minutes. The service holds a partial wakelock, does some work, and then calls a Broadcast Receiver through the Alarm Manager which starts up an Activity. The activity is created (or is resumed), turns on it's own wakelock, and sets up the camera preview surface. Once

When does android device go to sleep mode?

对着背影说爱祢 提交于 2019-11-27 01:20:21
问题 I was searching SO and web but i couldn't find sufficient answer for my particular question. Ok here we go: Every user can modify screen timeout on android. (when screen turns off when its idle for __ seconds/minutes - users choice ). But user can modify ONLY screen timeout and not when device goes actually to sleep. I found here what happens when device goes to sleep: (Really nice answer by CommonsWare) Android Sleep/Standby Mode Ok my question is simple. How do i know when my phone will go

How to use CPU to perform any operation in Deep Sleep mode

折月煮酒 提交于 2019-11-26 17:52:31
问题 I'm new in android . I struggle with my application approximately 3 weeks. I need sent and receive packets in normal mode and sleep mode . My app must exchange data a 5 seconds. I tried using alarmmanager but on android 5 it's not works. On android 5 an interval changes it on 60 seconds. Such a solution makes the battery wears out quickly. When I use normal asynctask, not IntentService , then it works only when screen is ON and app is visible. When app is hidden or I click power OFF then

How can I know when Windows is going into/out of sleep or Hibernate mode?

混江龙づ霸主 提交于 2019-11-26 16:27:16
问题 Is it possible to subscribe to a Windows event that fires when Windows is going into or coming out of Sleep or Hibernate state? I need my application to be made aware when the computer is going to sleep to do some cleanup and avoid timing issues when it comes out of sleep. 回答1: Microsoft.Win32.SystemEvents.PowerModeChanged event will give you this information. This event is available in all variants of the .NET framework released by Microsoft so far. 回答2: In .NET, use the PowerModeChanged

Android Sleep/Standby Mode

混江龙づ霸主 提交于 2019-11-26 12:46:59
I have made an app that starts a service, which starts a timer, which fires off a small function after an amount of time. This is working great on the emulator and on the Motorola Droid 1, but it doesn't work on the Droid X when the phone has been put into sleep mode. What I have discovered is that the timer seems to pause when the phone is in sleep. It doesn't seem to do this on the Droid 1, or the emulator. I'm sure the workaround isn't too difficult, so I'm not asking for help (for once) I just want an explanation, to better understand this. My question is what exactly does "sleep mode" do

Is there a away to detect the event when iOS device goes to sleep mode (when the screen gets blackened)?

痞子三分冷 提交于 2019-11-26 10:54:23
问题 I wanted to detect two events : Device gets locked/unlocked. Device goes to sleep and the screen blackens. First one I have been able to achieve here: Is there a way to check if the iOS device is locked/unlocked? Now I want to detect the second event, is there any way to do it ? 回答1: You basically already have the solution, which I'm guessing you found from one of my recent answers :) Use the com.apple.springboard.hasBlankedScreen event. There are multiple events that occur when the screen

Android Sleep/Standby Mode

自古美人都是妖i 提交于 2019-11-26 03:37:22
问题 I have made an app that starts a service, which starts a timer, which fires off a small function after an amount of time. This is working great on the emulator and on the Motorola Droid 1, but it doesn\'t work on the Droid X when the phone has been put into sleep mode. What I have discovered is that the timer seems to pause when the phone is in sleep. It doesn\'t seem to do this on the Droid 1, or the emulator. I\'m sure the workaround isn\'t too difficult, so I\'m not asking for help (for