[Q] Wake Lock in Samsung Galaxy Tab - Android Software Development

Hi all, I am developing an app in which i need to send and receive packets in background. But I've discovered that when screen shut off also cpu and networking is disabled. So I've found on Android Developers that I should use wake lock and wifi lock to let the cpu works altought if the screen went off. This solution works for other devices such LG Optimus One but not for Samsung Galaxy Tab. With this device when screen shut off I can't receive no more packets (UDP) and magically when I press power button for re enabling screen, I restart to receive packets.
In my code I call:
powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_W AKE_LOCK, "TAG");
then
wakeLock.acquire();
I think that is a Samsung bug but I'm not sure of this, and if someone can give me some hint i would really appreciate.
P.S. I need some programming help... I already know that if I modify some manual setting to avoid shutting down the screen, this will work. But I'm developing an app and i need code!!

Related

Request for application - Email notification

As discussed in this thread:
http://forum.xda-developers.com/viewtopic.php?t=41403
the new push email feature coming with the AKU2 update has what I believe to be a fatal flaw in that it does not seem to be able to wake the device up and notify the user when a new email arrives. So long as the device is not in standby mode, the notifications work fine but when it goes to sleep or the top power button is pressed, you lose the email notifications. My workaround is to turn off the automatic device off feature in the power settings and use AEButtons Plus to turn off the screen (the entire screen, not just the backlight) when I am not using the device. This is certainly not a perfect solution as there are times when I forget to turn the screen off or when a calendar or task notification turns the screen back on when I am not around the device (in this case, the backlight will time out but the screen will stay on until I turn it off).
All that is long-winded background for a request to the programmer types around for an application to solve this dilemna. I think the application would be quite simple and would simply provide for an automatic screen off feature after a certain period of inactivity. Ideally, this application might also be able to remap the power off button to turn the screen off as well, but this might have other negative consequences. Of course an application that would wake the devide up on receipt of a pushed email would be even better but I am giving MS the benefit of the doubt that such a feature might be difficult if not impossible to pull off at this time. There may be such an application out there right now, but if there is, I have not come across it.
I am sure there are few people that would be willing to pay for an application of this nature. Anyone?

automaticaly lock keyboard/screen when Idle?

Hi there.
Is there a way to automatically lock the screen and keys when the phone is idle for a while?
Kinda like the device lock funktion, but without entering a password.
I'm not worried about abuse, rather about accidentally activating telephone functions while carrying it around.
Basically I just want the phone to automatically push and hold the "hangup/lock"-Button when the phone is idle for 5 minutes.
I know something similar can be done in the system settings, but only in combination with a password which gets rather annoying over time.
alternatively: is there a way to deactivate WM6's password complexity rules (so it will accept empty/trivial passwords)?
Here you go...
Hey !
Use - csdevctrl -
http://forum.xda-developers.com/showthread.php?t=386451
Greets !
Hi fotoingo,
This is just what I needed - thanks.
As a non dev and just returning to WinMo after a long absence, please can you advise how I would get the hard keys on the X1 to work during a call and just disable the touchscreen?
Thanks

How to disable the device lock

I keep getting the device lock keypad popping up whenever I power up my phone or every hour which is the setting I have. But now I want to disable it. I think it automatically got set due to an exchange server I was connecting to but now I don't need that anymore. The device lock setup won't let me clear the pin number. Is there a registry setting I could clear? Any help is appreciated.

SMS notifications while in standby (findings)

So I've got the problem where when my phone is off/standby I don't get a notification or alert until I turn the phone on at which point it plays the standard alert and vibrate (this is of course useless).
Playing around and I noticed that this problem goes away when I uncheck the setting 'Turn device off after X mins'.
Now, at first I assume that there were 3 modes on the HD (and presumably on all htc phones) and they are: Power off, standby, on. Those states seem self explanitory. Give that assumption, I always thought that there was just a problem with the sms program doing a notification.
With this new solution, ie, disabling auto turn off, all my text messages come through with a notification within 6 seconds of sending it on the other end. But I played around with it some more. Some of you may know of a program called psshutxp. This program can do three things: display off, turn off, and reset. Now I never used this turn off feature before because I assumed it just turned the phone off. I activated this function with the auto turn off setting disabled (the phone doesn't auto turn off) and end up not receiving messages (exactly like the original problem).
What I've concluded then is that the device actually has 4 states: Power off, standby, display off, on. Now if you read the whole thing you may have noticed that I'm implying the solution is to disable auto off and thus leave the device in what would appear to be 'display off' mode. It works, certainly, but I'm starting to think that battery life is going to suffer immensely. (I'm going to test this tonight)
It seems we're back to square one, but wth a little, and albiet minor conclusion: SMS messages should wake the device but leave the screen off. There have been some intermediate solutions that say to change the 'disable device wake on sms' registry from 1 to 0 or use HD tweak to achieve a similar effect then combine this change with a good screen locker.
My question then is, is it possible to wake the device but leave the screen off via registry or via resident program?
Investigating the resident program option some more, is it possible to run compact framework programs while the device is in standby?
Finally, I know that the Touch Diamond 2 had a recent hotfix for this exact issue. Considering the similarities between the two devices, is it possible to port a solution? I'm going to see if I can try it out myself (but I'm not as experienced at platform modifications as I am in software development). I also noticed that a lot of Diamond 2 users still report the problem wasn't solved with that hotfix.
check out the HD Tweak app, i think it has a "wake on SMS" tweak you can apply to the phone. would also help if you mention if you're using a Stock or custom ROM. in my case, i'm using a custom ROM with SMS Chat and i'm gettting SMS notifications with my device in stand-by mode. fyi, i'm not using the HD Tweak app...
Yeah, the Wake on SMS on HD tweak as mentioned in my post basically modifies the registry for device wake on SMS.
However, this is not, and should not be normal behaviour as waking the device turns the screen on as well. (unless your device is different in that it doesn't turn on the screen at the same time as waking up from a SMS, if this is the case, then... that's a pretty significant finding.)
just tested my device... screen is off (e.g., hit the power button to turn it off) sent myself a txt via my email account, heard the SMS notification and screen is still off. i'm using a custom ROM miri v26.2.
I can achieve the same effect by disabling auto turn off. As in: my device remains off and the SMS notification is properly sounded. (everything works as it should)
However, I worry that the device isn't actually in standby and rather just has the display off (which means that background apps are still running). A possible concequence could be that it would drain my batt pretty fast ( this is my cheif concern).

[Q] How to wake up X2 without power button?

Hey everyone,
I want to change actual method, how to wake up my X2.
... by touch on the screen or any different key? That power button isn't so comfortable
I found some tricks, but only for HTC... May you help me?
#2 [Q] How i can set auto lock? e.g auto lock after 2minutes?
Again I found solutions only for HTC.
Help is here..........
Hello to You!
For the wakeup, you can slide out the keyboard and sometimes the phone wakes up!
Other than that, nothing! You can find the registry settings for that and change it there. When you do, let us all know Because so far, nothing!
Then there is a program, that can change button assignments, but I don't know if that works for WakeUp..., do a search here or on Yahoo (don't like google). Or search the Internet per se
About the lock screen, go to Settings, AutoLock -check that- then go to the link that shows below (Backlight and Power Management) there you select the time ie. 2min, for the screen to turn off.... voila. When the screen turns off in 2 Minutes, so will the Lock engage!
Have fun!

Categories

Resources