sleep-mode

How to prevent app from closing when android device goes to sleep

点点圈 提交于 2019-12-13 07:49:52
问题 How do i prevent my app from closing when the device goes to sleep mode, i obsevered that anytime my device goes to sleep mode my app closes but i want it still open when my devices comes out of sleep mode. 回答1: Probably it is because you call the finish() method in the onPause(). 来源: https://stackoverflow.com/questions/28811831/how-to-prevent-app-from-closing-when-android-device-goes-to-sleep

How to prevent app from closing when android device goes to sleep

爷,独闯天下 提交于 2019-12-12 07:06:40
问题 How do i prevent my app from closing when the device goes to sleep mode, i obsevered that anytime my device goes to sleep mode my app closes but i want it still open when my devices comes out of sleep mode. 回答1: Probably it is because you call the finish() method in the onPause(). 来源: https://stackoverflow.com/questions/28811831/how-to-prevent-app-from-closing-when-android-device-goes-to-sleep

Connectivity Change Broadcast receiver not triggering when phone is in sleep mode

喜夏-厌秋 提交于 2019-12-11 05:14:02
问题 I have a network state change Broadcast Receiver setup for my app. I need to receive wifi connect-disconnect events even when phone is in sleep mode. This works when phone is charging and in sleep, but doesn't when its not in sleep. here is code public class NetworkConnectionReceiver extends WakefulBroadcastReceiver { public static final String INTENT_CONNECTIVITY_CHANGE = "android.net.conn.CONNECTIVITY_CHANGE"; @Override public void onReceive(Context context, Intent intent) { if (intent

Turn on the Internet on Android when in sleep

好久不见. 提交于 2019-12-09 11:44:50
问题 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 its turning the data on, but it still does connect to the server. What I tried: When I turn the data manually off, then the app is turning it on and it works I also tried WakeLock, but it did not help. The alarm works as expected, even when the

HAL_RCC_OscConfig takes too long (appx 170 μS), I need it to be <50 μS when waking from STOP

我怕爱的太早我们不能终老 提交于 2019-12-06 05:24:46
问题 Development for STM32L053R8 on NUCLEO-L053R8 board. We have a system which "wakes" from sleep every 200 μS or so, does a small amount of work then goes back to sleep (Stop mode). Ideally I'd like to wake from STOP in under 50 μS. The HAL_RCC_OscConfig() function takes around 170 μS which renders this effort pointless. From what I can see the majority of time is spent with the PLL Configuration, in particular the while loop ("Wait till PLL is ready") which follows the re-enablement of the PLL

Android/Smack: Keep XMPP connection alive in sleep mode

做~自己de王妃 提交于 2019-12-04 20:49:37
问题 I have an Android application that has a chat client as one of its features. The chat client uses XMPP based on the Smack library for Android and running Openfire as XMPP server in the background. The connection is established using BOSH The whole XMPP connection handling is implemented as a service to run and listen in the background for incoming messages even if not activity of the app is in the foreground. So far, everything works perfectly fine. The only problem seems to be the sleep mode

HAL_RCC_OscConfig takes too long (appx 170 μS), I need it to be <50 μS when waking from STOP

馋奶兔 提交于 2019-12-04 12:50:31
Development for STM32L053R8 on NUCLEO-L053R8 board. We have a system which "wakes" from sleep every 200 μS or so, does a small amount of work then goes back to sleep (Stop mode). Ideally I'd like to wake from STOP in under 50 μS. The HAL_RCC_OscConfig() function takes around 170 μS which renders this effort pointless. From what I can see the majority of time is spent with the PLL Configuration, in particular the while loop ("Wait till PLL is ready") which follows the re-enablement of the PLL (about 98 μS). /* Configure the main PLL clock source, multiplication and division factors. */ __HAL

Android/Smack: Keep XMPP connection alive in sleep mode

怎甘沉沦 提交于 2019-12-03 14:41:52
I have an Android application that has a chat client as one of its features. The chat client uses XMPP based on the Smack library for Android and running Openfire as XMPP server in the background. The connection is established using BOSH The whole XMPP connection handling is implemented as a service to run and listen in the background for incoming messages even if not activity of the app is in the foreground. So far, everything works perfectly fine. The only problem seems to be the sleep mode. In the emulator (when set to "Stay Awake") or with the phone in use, the XMPP connections is holding

prevent mobile from going into sleep mode when app is running

老子叫甜甜 提交于 2019-12-01 15:59:36
问题 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 restart the app. what to do? please help 回答1: You need a WakeLock. There are different kinds of wake locks so be sure to select the least aggressive one that meets your needs. In particular it sounds like you need a Partial Wake Lock. Partial Wake

Java Thread.sleep() on Windows 10 stops in S3 sleep status

牧云@^-^@ 提交于 2019-11-30 17:37:44
There's a desktop application that uses Thread.sleep() to achieve long (minutes or hours) delays. This same application has been working fine from Windows XP through (at least) Windows 7. The application calculates how far in the future it needs to do something, then hits a Thread.sleep(msToWait). This has been working fine, even if the system happens to go into S3 sleep state during the wait. As of Windows 10, though, the code after Thread.sleep() does not execute "on time" if the machine has been in S3. It appears that the machine begins executing code at "msToWait" plus the time the machine