I'm developing an app that needs the screen to stay on because if not the wifi connectivity is compromised.
In my code I call:
powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "TAG");
then
wakeLock.acquire()
but my screen continues to turn off.
Is it a bug or my mistake???
Thank in advance for responding.
flyhalf86
shouldnt this be in question and answer
Just get Spare Parts+ from Android Market and change "Wi-Fi Sleep Policy" to value "Never"
You are probably better off asking the question in the generic Android Development forum, instead of the SGT specific one.
i'm sorry if not in the correct section.. but my code with other devices works good and only with Samsung Galaxy Tab doesn't works as expected. So I thougth that was a device specific behaviour..Aren't there any developers that can try on this device???
ravness said:
Just get Spare Parts+ from Android Market and change "Wi-Fi Sleep Policy" to value "Never"
Click to expand...
Click to collapse
This is the answer you are looking for.
Or Settings>Wifi>Advanced Settings>Wifi Sleep Policy
Ive never had any issue with Wifi issues when the screen is off when ive turned the sleep policy off.
| Don't Revive Me Bro! |
GANJDROID said:
This is the answer you are looking for.
Or Settings>Wifi>Advanced Settings>Wifi Sleep Policy
Ive never had any issue with Wifi issues when the screen is off when ive turned the sleep policy off.
| Don't Revive Me Bro! |
Click to expand...
Click to collapse
Cool never knew this
Related
Hi all,
I have 4.0.4 stock gnex.
My wifi settings are this:
Settings->Wifi->(Menu Button)->Advanced. It's listed as "Keep WiFi on during sleep"
When the phone go to sleep the wifi seems to stop, I am downloading an app
from the market, when the phone go to sleep, the download sleep.
Not to doubt you on this but does it also say "Always" beneath the "Keep Wifi on during sleep"? If so, perhaps you have an app that overrides that and disables it.
I have no app that can do it.
Hi, I just tested and had no problems downloading a 50 meg game with screen off.
From honeycomb on google changed how wifi was handled when screen is off. This gives similar problems with older applications but should not be a problem for apps made by Google like Play and Music.
You still did not answer the previous posters question. You reference the advanced wifi setting but not what it is set to.
Sent from my Galaxy Nexus using Tapatalk 2
atkhobby said:
Hi, I just tested and had no problems downloading a 50 meg game with screen off.
From honeycomb on google changed how wifi was handled when screen is off. This gives similar problems with older applications but should not be a problem for apps made by Google like Play and Music.
You still did not answer the previous posters question. You reference the advanced wifi setting but not what it is set to.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
It's obviously set to always
People have had issues with the setting you choose in that menu not sticking. Try toggling it back and forth and doing some reboots. I don't have the issue on 4.0.4.
From what I understand, when the screen turns off wifi goes into a low power state, draining less battery when on standby. So it greatly reduces the speed (sometime pauses) of all connections to save juice.
KiNG OMaR said:
From what I understand, when the screen turns off wifi goes into a low power state, draining less battery when on standby. So it greatly reduces the speed (sometime pauses) of all connections to save juice.
Click to expand...
Click to collapse
I understand if it slowed down, but it shouldn't ever pause though.
This low power state is what I referred to in my previous post. An app must now explicitly request that high power wifi mode is retained when screen is off. All apps from google should be doing this already.
Unprofessional app developers that have not been reading up on the latest changes in android api (like Audible!!! shame on you) will have major slowdowns downloading over wifi when the screen is off.
Sent from my Galaxy Nexus using Tapatalk 2
I have the exact same problem as posted here And I may have found the solution at this other link here.
What seems to be working for me is the change the "Keep Wi-Fi on during sleep" to "Never (increases data usage)". That totally does not make any sense to me. If you 'never" keep wifi on during sleep it should *not* increase data usage. Anyway, I have noticed two things:
1) If I set it to "Never," the files continue to transfer when the screen goes to sleep
2) Wifi transfer rate seems to be *much* faster on my home network. I'm using ES File Explorer, so it could be app related.
Just discovered that according to Google, "Never (increases data usage)" means that it will not stay connected to WiFi while asleep which will increase your 3G/4G data usage. Never the less, it seems my Wifi is better when set to "never"
I wrote an article about wifi usage on my blog here: http://zapek.com/?p=262
You shouldn't worry about PS-Poll mode. It's fine for downloads usually as they don't require a fast interactive response.
Sent from my Galaxy Nexus using Tapatalk 2
KiNG OMaR said:
From what I understand, when the screen turns off wifi goes into a low power state, draining less battery when on standby. So it greatly reduces the speed (sometime pauses) of all connections to save juice.
Click to expand...
Click to collapse
this could be a possible reason, in my office wifi is not really powerful,
a low power state can disconnect the wifi.
I'm checking better the problem, it seems that the wifi goes into some sort of
energy saving mode when the screen is off that drop my wifi speed.
Is there a way to solve this problem?
it seems that I'm not the only one with this problem-
http://productforums.google.com/forum/#!topic/mobile/DJTwAutjsIQ
so no solution to this problem yet ?
sblantipodi said:
it seems that I'm not the only one with this problem-
http://productforums.google.com/forum/#!topic/mobile/DJTwAutjsIQ
Click to expand...
Click to collapse
This is not the same problem that you have. The thread you link to is about general download problem with screen off. Your problem was about downloading from the market while screen is off.
Sent from my Galaxy Nexus using Tapatalk 2
atkhobby said:
This is not the same problem that you have. The thread you link to is about general download problem with screen off. Your problem was about downloading from the market while screen is off.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
sblantipodi said:
Click to expand...
Click to collapse
In your original post your wrote that you had problems downloading from the market with the screen off.
The android market is a google app and should not have the problem discussed in the thread you linked to.
The problems in the thread relates to applications that have not yet been updated to support power saving features in resent android versions.
So your problem is not the same.
I did write this in my previous posts from may 25. but maybe it was unclear.
Sent from my Galaxy Nexus using Tapatalk 2
atkhobby said:
In your original post your wrote that you had problems downloading from the market with the screen off.
The android market is a google app and should not have the problem discussed in the thread you linked to.
The problems in the thread relates to applications that have not yet been updated to support power saving features in resent android versions.
So your problem is not the same.
I did write this in my previous posts from may 25. but maybe it was unclear.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
the problem is present in all apps, google one and non google one so you don't understood the problem
sblantipodi said:
the problem is present in all apps, google one and non google one so you don't understood the problem
Click to expand...
Click to collapse
Hey its no problem. It's only that this is the first time you state that you have problems with all apps.
I still don't understand why you have problems downloading apps though. I have tested and do not have this problem BUT I do have the problems with most other 3rd party apps.
Anyway there is a fix that probably will help you. Download "WIFI High performance' widget from the market. Add the widget and enable it. Good luck.
Sent from my Galaxy Nexus using Tapatalk 2
Under display and gestures option I have sleep set at never turn off and Stay Awake is checked also , under developer options I have stay awake checked. Under wifi I have high performance mode and keep Wifi on during sleep chosen. And still this POS keeps going to sleep. Does anybody have a solution for this ? thanks
Why would anyone want the phone to stay awake and drain the battery?
Stay awake is only for when charging. If you have the display Timeout set to never and it is still turning off you have problems.
Sent from my Galaxy Nexus using xda premium
There's an app by runks on the play store called stay awake. It'll do what you ask.
I leave my display on with a recipe up so I don't have to keep unlocking it with floury hands
Sent from my Xperia Play using XDA (HOX RMA'd)
just answer or don't post
DARKKRAKEN said:
Why would anyone want the phone to stay awake and drain the battery?
Click to expand...
Click to collapse
What do you care why they want to do this? If you don't have helpful information don't post! Geeesh, I'm sick of wasting my time reading these types of posts on forums, it just makes finding answers difficult and time consuming.
This is a big problem when driving and using GPS. The device is plugged in but then dims after a minute or so, making it nearly impossible to see in daylight.
What can I do to prevent it from ever dimming while charging?
Settings>screen dimming
Turn it off
proud a-clown said:
Settings>screen dimming
Turn it off
Click to expand...
Click to collapse
I do not see that in settings. CAn you please be more specific?
And I only want it to not dim while it is charging.
Thanks.
synpax said:
This is a big problem when driving and using GPS. The device is plugged in but then dims after a minute or so, making it nearly impossible to see in daylight.
What can I do to prevent it from ever dimming while charging?
Click to expand...
Click to collapse
There is this OLD free app I have been using for a long time. SIMPLE and EFFECTIVE.
It's a Screen On Widget. When you want the screen to stay on, simply click either a SHORTCUT or a WIDGET. You can disable from the notification bar as well. It's a manual solution. There are other automatic solutions, but they will cause some battery drain and mild cpu. It's hard to find. I uploaded it here.
themadproducer said:
There is this OLD free app I have been using for a long time. SIMPLE and EFFECTIVE.
It's a Screen On Widget. When you want the screen to stay on, simply click either a SHORTCUT or a WIDGET. You can disable from the notification bar as well. It's a manual solution. There are other automatic solutions, but they will cause some battery drain and mild cpu. It's hard to find. I uploaded it here.
Click to expand...
Click to collapse
Actually try this
Settings>Applications>Developement>Stay Awake
Had a bug with Extended Controls that would turn this back on after reboot. That's how I know it works.
dratsablive said:
Actually try this
Settings>Applications>Developement>Stay Awake
Had a bug with Extended Controls that would turn this back on after reboot. That's how I know it works.
Click to expand...
Click to collapse
This option is removed in TouchWiz, its an AOSP option. However, this is one if the first things I've re-added to TouchWiz. OP, if you can survive until Monday, I'll post up a flash able package to re-enable this option.
Sent from my Samsung Galaxy S III
As promised, here's a CWM flashable package that will re-enable the "Stay Awake" option in Settings > Development.
This is for the SGH-I747, UCALH1. This package is for a stock, deodexed ROM, so if you're running an odexed ROM you'll want to delete your /system/app/SecSettings.odex file after flashing.
Enjoy!
as a precaution just remember that Samsung removed the option to prevent burn-in to the amoled screens, something that was a big problem on the epic 4g. also to reduce wear on the leds.
Sent from my Galaxy S III
There is enough life for 2 years of usage in OLEDs.
dLo GSR said:
as a precaution just remember that Samsung removed the option to prevent burn-in to the amoled screens, something that was a big problem on the epic 4g. also to reduce wear on the leds.
Sent from my Galaxy S III
Click to expand...
Click to collapse
I use screebl witch let's you control the screen from dimming or turning off by orientation..
https://play.google.com/store/apps/details?id=com.keyes.screebl.lite&feature=more_from_developer
Sent from my SGH-I747M using xda premium
If it helps: I used tasker to detect charging and set the timeout and brightness. Then reset after disconnect.
My screen was too dim otherwise and couldn't see the TuneIn song.
Sent from my SAMSUNG-SGH-I747 using Tapatalk 2
Old thread, but yeah, just got update..
Obviously a "Big Red" subscriber, so my GNex was just updated to 4.2.2. I've re-enabled the dev option to prevent sleep, turned off daydream, and even used an old 3rd party app (stayawake) and NOTHING is working... Any new ideas out there? I travel a ton for my job, and my phone is my dash mounted assistant in everything from directions, voice notes, lectures, and reminders (and rare texts... shhh, it's illegal in my state...) There has to be a way to keep this thing awake post update...
Please read forum rules before posting
Questions and help issues go in Q&A
Thread moved
Thank you for your cooperation
Friendly Neighborhood Moderator
Hey all,
Not sure if im the only one who has this but..
When ever i enable the setting Stay Awake (screen will never sleep while charging), it will do so, but later on i notice it doesn't do it anymore.
Then i check the setting and i notice the setting is disabled.
Then i enable it again, and later on its disabled again by itself.
I had this with the stock rom, wanam rom, and now also with the omega rom.
Whats the deal with that?
anheuer said:
Hey all,
Not sure if im the only one who has this but..
When ever i enable the setting Stay Awake (screen will never sleep while charging), it will do so, but later on i notice it doesn't do it anymore.
Then i check the setting and i notice the setting is disabled.
Then i enable it again, and later on its disabled again by itself.
I had this with the stock rom, wanam rom, and now also with the omega rom.
Whats the deal with that?
Click to expand...
Click to collapse
My EVO 4G had a no-timeout setting and I loved it because the screen would stay on whether it was charging or not. I went looking for an app that might do that and found this for you:
https://play.google.com/store/apps/details?id=com.beansoft.keepScreenOn&hl=en
anheuer said:
Hey all,
Not sure if im the only one who has this but..
When ever i enable the setting Stay Awake (screen will never sleep while charging), it will do so, but later on i notice it doesn't do it anymore.
Then i check the setting and i notice the setting is disabled.
Then i enable it again, and later on its disabled again by itself.
I had this with the stock rom, wanam rom, and now also with the omega rom.
Whats the deal with that?
Click to expand...
Click to collapse
I have the exact same problem from time to time, and im running usa at&t stock. The only thing I can think is maybe I accidentally hit power saver at some point and it clears the stay awake.
-----
I would love to help you, but help yourself first: ask a better question
http://www.catb.org/~esr/faqs/smart-questions.html
My stay awake option always turns off after a reboot, and my power saving option is off. Haven't figured it out yet.
Galaxy Note 2 > Rooted Stock ROM > Tapatalk 2
Hi, I saw many posts related to this topic Wi-Fi turns off when phone in deep sleep but not able to find a single working solution.
My phone runs on 4.2.1 with wi-fi sleep policy set to NEVER ( that means always on ideally ) , and tried turning on / off wifi optimization, avoid poor connections is not ticked.
Even after doing everything the wifi is turned off after sometime and when i turn on Screen it turns it back! How to do I solve this?? I am using STOCK rom, with just root.. No other battery saver etc. app installed.
emptyragnarok said:
Hi, I saw many posts related to this topic Wi-Fi turns off when phone in deep sleep but not able to find a single working solution.
My phone runs on 4.2.1 with wi-fi sleep policy set to NEVER ( that means always on ideally ) , and tried turning on / off wifi optimization, avoid poor connections is not ticked.
Even after doing everything the wifi is turned off after sometime and when i turn on Screen it turns it back! How to do I solve this?? I am using STOCK rom, with just root.. No other battery saver etc. app installed.
Click to expand...
Click to collapse
Set it to Never instead of Always. Its ass backwards.
scottx . said:
Set it to Never instead of Always. Its ass backwards.
Click to expand...
Click to collapse
OP stated its already set to never
Sent from my Vivid 4G using Tapatalk 2
well i have this problem too on every jelly bean rom. the only rom without this problem in cm10 stable. now i'm with cm10.1 hoping they'll fix it like in cm10.
when that problem comes out just toggle on and off airplane mode and it should disappear until next wifi toggle off and on.
I hope google will solve it in key lime pie
CM 10.1 has only just started doing this in the last week or so, it was fine before. Was wondering if it was just me with this issue or not...
emptyragnarok said:
Hi, I saw many posts related to this topic Wi-Fi turns off when phone in deep sleep but not able to find a single working solution.
My phone runs on 4.2.1 with wi-fi sleep policy set to NEVER ( that means always on ideally ) , and tried turning on / off wifi optimization, avoid poor connections is not ticked.
Even after doing everything the wifi is turned off after sometime and when i turn on Screen it turns it back! How to do I solve this?? I am using STOCK rom, with just root.. No other battery saver etc. app installed.
Click to expand...
Click to collapse
Am i correct in understanding that you don't want it to disconnect? The option in the settings is "Keep wifi on during sleep". If you have it at Never, then it will disconnect when the phone goes into sleep. It should be placed on Always because you want it to be on even during sleep
Flowed and Tapped from my Nexus
fixed the wifi problem
Heya! My first post!!!
So, i had the same problem on my Allview P5 Quad.
The guys from Allview released an update for my phone based on 4.2.1 and i thought the problem was from them. I had WiFi turned on and after a few minutes from entering sleep mode, the WiFi got disconnected, both WiFi and data. I have installed the last update again and again, rooted, unrooted, tried every option from WiFi and i still had the same problem.
So i timed the time when the WiFi disconnects and it was exactly 6 minutes. So i thought that it must be an option that does this. So i unchecked the Quick Power Saving icon from Switches and ... SURPRISE! My WiFi stays on continuously. So, the problem is from the system power saving settings. I hope this helps all of you.
P.S. Love this forum! Thanks for all your help!
I believe I found the problem, some how it is not the phone but my wifi router (and all routers) is the problem. Go into your router settings and look for the "Beacon Interval" and set that number to 50. I'm not going to explain what the beacon interval is, go google it and you will see. I switched mine and now the wifi on my phone does not switch off when in deep sleep.