Android :: Disabling Screen Sleep Programmatically?
Nov 24, 2010how to prevent the Android Activity from sleep mode programatically. Or can we declare something related to this in Android Manifest file.
View 2 Replieshow to prevent the Android Activity from sleep mode programatically. Or can we declare something related to this in Android Manifest file.
View 2 RepliesI have an app which displays a large amount of text for the user to read. I've found that when reading while lying down, I get annoyed that the screen rotates even though my head and the screen are aligned. I do not want to set this to be permanently in portrait mode, so I think this would preclude an approach of setting the android:screenOrientation="portrait" in the manifest. Ideally, I would like to enable/disable automatic orientation changes via a preference page.
View 1 Replies View RelatedAbout custom Power Management... Is it allow for my app to dim the screen programmatically??, the goal would be to send the phone sleeping when a Intent.ACTION_BATTERY_CHANGED event is handled by a BroadcastReceiver, just like its done automatically by the OS (if so configured) after x time of inactivity.
View 2 Replies View RelatedI have written code to enable and disable various things programatically like Wifi, Ringer modes, Airplane modes. All things that you would see in a power toggle widget. The one that I have not found out how to do is bluetooth. It appears that in SDK level 3 (OS 1.5) there is no pretty bluetooth manager class. Has anyone pinpointed any good source examples on enabling and disabling bluetooth that will also be forwards compatible with users running 2.0 (Droid) / 2.1 (Nexus)? I have found a few partial examples in my google searches that I could not get to actually run.
View 1 Replies View RelatedI asked this a while back and didn't get anything useful. I'm hoping now that Android has advanced a few releases, that there will be more options. Here are the things I'm trying to accomplish: Prompt for a PIN when you uninstall a particular app. This would have been set at install time by the user. Disable certain services (text, phone). What would be even better is if I could be selective about it instead of just turning the radios off. For example:
a. intercept outgoing call, is it to one of a few allowed numbers?, yes
=> allow it, no => deny
b. intercept incoming call, is it from one of a few allowed numbers, yes =>...........................
My app seldom needs to put the device (or screen) to sleep. That is - programmatically imitate user pressing on red stop-call button. According to docs PowerManager.goToSleep() does just that, but requires android.permission.DEVICE_POWER, which is never granted to apps!
(A) What on earth should I do to get this working?
(B) How can I programmatically wake up the device.
just to clarify - I'm not interested in a wake lock solution.
I can't seem to UNcheck the box to disable the unlock pattern. Please tell me there's a way as I am now sick of having the draw the pattern.
View 4 Replies View RelatedIs there a way to draw on or modify the key guard wallpaper programmatically?It looks simple enough for the home wallpaper, you can use WallpaperManager. But how about for the lock screen wallpaper?
View 1 Replies View RelatedI have a rooted orange hero to mcr2.3 On the lockscreen, is there a way of disabling the graphic which goes across the screen? The graphic contains the time and the word orange etc. I would like an arty picture on my lockscreen but the time graphic spoils it. Catch my drift?
View 12 Replies View RelatedIs there any way to get my Droid to only lock the screen when I manually hit the lock button? If using it as a mp3 player for instance it's horrible to have to unlock it over and over again every time I want to skip a track or something.
View 11 Replies View RelatedI am just getting tired of the lock screen on the Hero. My main problem with it is that, if I use the stock Messaging app, the messages show on the bottom...even though i have my phone locked with a pattern lock. I know I can use handcent and not have to deal with it, but I just want to know how to get rid of the stupid lock screen. I've read around a few places, and I know it's possible on 1.5, but I'm not too sure if it's possible for 2.1. Does anyone know where I can get instructions on who to disable the lock screen for 2.1, if it's even possible. My phone is rooted. Also, if I do disable the lock screen, and then i decide to put in a new ROM on my phone, what will happen?
View 1 Replies View RelatedIf you go to the application section in the settings, click on touchflo and click clear defaults. Then press home. Select, "Home" over "Touchflo", do you get the nexus one style homescreen?
View 3 Replies View RelatedIm still looking for a widget to put my Incredible to sleep without pushing the power button. I am using No lock for the ability to use the touchpad to turn on but I hate using the power button to turn it off and leaving the screen on, even for 30 seconds, has to be draining the battery. (I am constantly on/off/on/off the phone throughout the day.)
I would like something I can put on the home screen that when touched, puts the phone to sleep. This will help save my power button in the long run as well. Ive searched and cant find anything.
I'm looking around and trying to find out where sleep behavior is documented - and I mean in the general sense.
When the phone is left alone: * Sometimes the phone screen dims and doesn't shut off. * Sometimes the phone screen goes dark in five seconds * Sometimes the menu lock happens. * Sometimes the menu lock doesn't happen. * Sometimes the only way to darken the screen is to push the power button.
What's not clear is what triggers these different states. I'm looking for a complete list I can use in testing and application validation.
I wrote a service and I registered BroadcastReceiver in it. In the onReceive () method of BroadcastReceiver catagory,I just wrote Intent.ACTION_TIME_TICK.equals(intent.getAction()) to receive the systenm time every minute and deal with everything that I should do in it every minute.But i found a problem that when the mobile phone screen was locked and was completely black,my service seems to be sleep and does not work,and when I light up the screen(it is still in locked condition),the system will automatically run my service.I do not know the reason,I guess if it is because my service is not the system-level service? When the mobile screen is black,Andraid system will hibernate the sevice which is not the system-level service,so if this,I should add my service to system service,but I know how to use android.permission.ADD_SYSTEM_SERVICE? If you can,please send me a example about how to add own service to system-level service.This problem has been troubled me for two weeks.
View 2 Replies View RelatedI am an android developer I have a problem..
I want to be get notified when the phone screen goes to sleep Help with a sample code.
My application is launched on car docking event, i want to wake up phone (done by system) and unlock screen when i plug my device.
View 2 Replies View RelatedI want to go to home screen programmatically in android when i clicked on button. How can i do this?
View 1 Replies View RelatedHow can we turn on/off GPS programatically without going on setting screen in android?
View 2 Replies View RelatedHow do I go to previous screen manually.say 'on button click'?Its similar to imitate the BACK button click.
I used below code but no luck.
startActivity(new Intent(ViewOfferActivity.this, this.getCallingActivity().getClass
How to get the screen density programmatically in android?
I mean How to find the screen dpi of the current device?
I am working on a remote automated test framework for Android based on JUnit (tests run outside android, interacting with code inside it). It's all working fairly well, but one issue I have is that when I automatically start a fresh emulator, the screen starts out locked. This appears to affect my tests being able to run, plus, I want to watch the tests run (buttons clicked, text typed, etc.). If I manually start an emulator and unlock its screen, all works well.
Is there a way to programmatically unlock the screen in Android? A Java API, a command line or shell command, etc. would all be fine. Barring that, perhaps there is a way to start an emulator unlocked?
I am looking for a widget that will put the screen to sleep like the power button does, but a widget on the screen. I know it sounds stupid, but when the phone is in the cradle in my car, it would be much easier to tap a widget on the screen to turn screen off than push down on the power button. I have a lock program that allows me to use the trackpad to wake the screen up, but have not found one to put the inc to sleep.
View 5 Replies View Relatedis locking the screen the same as sleep or is there a difference?
View 2 Replies View RelatedJust got an incredible (ebay - had to get rid of Eris) and New, out of the box the phone powers up fine. But the minute it comes out of sleep mode, the screen has scrolled to a different location - however, I need to actually push the screen in the location where the button I want to press should be located.
Have been searching here for an hour, but can't find anything like this so had to make a new thread. Sorry if it's a duplication.
This has happened to me a few times now. If I miss a call, or get a voicemail, the screen will turn on as usual but then it won't sleep until I either press the power button or unlock the phone. The screen will stay on indefinitely (on the lock pattern screen). This only started happening after I updated to 2.2. So now if I'm away from my phone and get a call, the battery will be almost completely drained by the time I get back to it (sometimes up to 4 hours later). This might also be happening if I get a calender notification too...anyone know what's going on?
View 2 Replies View RelatedAs we know that Android phone gets locked after screen timeout. But I want to lock the phone on demand as well. i.e. without waiting for screen timeout to occur.. As in nexus android phone there is hard button on top for making screen turn off and lock the phone. i have to do same functionality but by using soft key i.e. in a programmatic way. What are the APIs or routines that can help me ? Can someone point me for getting this functionality?
View 5 Replies View RelatedHow to create a folder in main screen programmatically?
View 5 Replies View RelatedI have some questions related to Android's home-screen contents:
1) Is there a way to programmatically delete a home-screen shortcut on Android? I know that it can be done manually but I want to do it in code.
2) Is there a directory where all the contents of the home-screen are stored and, if there is, is there a way to update the contents of this directory?
Today I am looking for a way to mimic the behavior I know from my HTC Hero's lock screen: the calendar and alarm clock can put text & drawables there to inform about an upcoming event or an expired alarm. The lock screen remains there in that it must be dragged down to dismiss the shown event and there might also be a Snooze button.
But, first question: is this default Android stuff or HTC Sense specific only??
Second question: If it is a common Android thing, why can't I find anything in Google's Android documentation for the topics "lockscreen" or "lock screen" that comes close to my question? Where's the API for it?
My problem is: I want to inform the user immediately - even if I try a standard notification, the user with a locked screen will have to unlock it and drag down the notifications list to see & clear what's going on. sigh Putting an endlessly playing notification sound there is a hassle as it takes at least two swipes down to stop the sound playing!