Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Android


Android :: How To Make Device To Sleep?

I know that there is a PowerManager class and a goToSleep method in SDK But the code follow does not work.Anybody can tell me why?

View Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Android :: How To Find Out If Device Is In Sleep Mode?
I am sure it is buried in the SDK somewhere but I couldn't find it. This is relevant to a service running in the background: How can I find out if the device is in sleep mode?

View Replies!   View Related
Android :: Putting Device To Sleep And Wake Up Programmatically?
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.

View Replies!   View Related
Motorola Droid X :: App To Make Sleep Button?
I tried the market and searched google (only to find apps that help you sleep lol). I'm looking for a way to set a button on the home screen to press and put the phone to sleep instead of having to push the top button all the time.

View Replies!   View Related
HTC Incredible :: Prevent Sleep During Call / Make Phone Lock Automatically (like An App)?
Usually the phone is awake, and when you lower it the phone lights up for numeric input (love that feature).

But after a minute or so it locks. You have to push power button before you can enter numbers- annoying. Is there a "keep alive" option I'm not seeing?

On a similar note, is there a way to make the phone lock automatically (like an app)? It's also annoying to have to manually lock it: I'd rather keep waking it up (if it was indeed idle and not running a program) than forget to lock it and dial/message everyone in my contact list from my pocket.

View Replies!   View Related
Android :: How To Make Screen Shoots With Device?
Can anyone tell me please how can i make screen shorts with an android device. I have to test an application,and to make screen shorts on it. and i need and screen short tool that will run in the background, while i am running my application. Is it possible. Please give me an advice, a link where i can find this kind of the application

View Replies!   View Related
Android :: How To Make Service Run / When Device Is Not Awake?
my application objective is to save location updates every ,let say, 20 minuets .I used service and it worked fine , but when i lock the screen or it is locked automatically the service stop running .when i unlock it , service runs again.How to make my code run all the time in all conditions?

View Replies!   View Related
Android :: Best Way To Make Games Run At Same Speed On Any Device
I have a game out on Android, and it runs in a single thread. Performs the work in run() and the draws in onDraw().Pretty simple.However, on a Droid it runs much faster than on a G1.What is a best practice for ensuring that the game runs at the same speed regardless of the device?

View Replies!   View Related
Android :: How To Make Device Boot When Power Is Plugged In?
I need to use this for a Samsung Tablet.Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing an animated battery.Instead I want to let it boot.I suspect this is close to the metal. Where do I have to make a modification?In the kernel, in the Android platform, or is this hidden in some proprietary code of the manufacturer?

View Replies!   View Related
Android : How I Can Make My Virtual Device Support Applications That Require More Than 2.5MB
Apparently my app needs 2.5 MB (maybe because my photos need 2MB...) and then virtual device can't work with that much MB.

How can I make my virtual device support more than 2.5 MB to get my application working?

View Replies!   View Related
HTC Hero :: Market Enabler Make Device Reboot
Everytime I try to fake another provider, my Hero reboot. It was working before I run MoDaCo 2.9.

View Replies!   View Related
HTC Droid Eris :: Auto-rotation From Sleep Mode / Delay In Waking From Sleep Mode
I apologize if these topics were already covered in previous threads.I wasn't able to find anything related in my searches. Auto-rotation for keyboard when answering a text message received in sleep mode does not work. If I actively send a text when phone is already awake, keyboard rotates with no problem but when I go to reply to a text that I received while phone is in sleep mode, the keyboard does not rotate. Is this the norm?I am also experiencing a delay when the I wake the phone. After unlocking the phone, I used to go straight to my home page, now I get a "loading" message which takes several seconds. Is this due to the number of apps I have loaded? Is it possibly due to number of photo frames I have on my home screen or the complexity of the wallpaper?

View Replies!   View Related
Android :: Modes Connectivity Device Identification & Device Inter Communication?
Can someone explain a couple of very simple concepts to me - I'm interested in mobile devices running android and how they are identified over networks. Some scenarios: Device is connected over WiFi - presumably the device has a standard IP address as with any host and can communicate with any other android host over TCP/IP (assuming it knows the participating device's IP? device is connected over bluetooth - how are devices identified in this case? device is connected over mobile operator's network - this is the one I'm interested in and confused by - is there anyway for two or more devices to discover each other and communicate via the mobile operator's network? How does a device communicate with a backend server in this scenario? In other words, how do apps and devices communicate when not connected to a WiFi network?

View Replies!   View Related
Android :: Permission Denied On Device - Emulator Failed On Device
I have developed and tested my app on the emulator, and now want to install it on my HTC device. the apk installs successfully, however my database is not going with it. I have created my database using sqliteman browser b/c I have to insert a bulk data before the app starts. I have four tables in my db and call each in different activities and created all on the sqliteman. after the data is inserted I pull back the db onto the data folder of the emulator. it works perfect on the emulator but failed on the device. when I try to pull my db on the real device, it shows access denied problem

View Replies!   View Related
Android :: Multiplayer Game - Device To Device Connection Using Sets Of Api
I have developed a sports game which is single player. Now I want to have one more game mode which is multiplayer.

My question is how can i do device to device connection in android using sets of api which can be :

1.Bluetooth - whose APIs are not currently available.

2.gtalkservice - removed from sdk1.0 3.wifi - I dont knw how to connect 2 devices using wifi apis . I have asked about wifi because we have developed a game on iphone which used wifi connection for multiplayer stuff.

Or is there any other apis which can be used for implementation of multiplayer in game ?

View Replies!   View Related
Android :: Device Orientation / Mapping Device Y To Screen Y
How do I map the device Y axis to the screen Y axis?I can't figure this out.I'm the developer of Tricorder, and I'm trying to make it so that the accelerometer and magnetometer indicators I draw always point in the right direction.On the G1 phone with the slider closed, all is well.But when I open the slider, I end up showing that gravity is pulling me to the left (if the phone is held with the display vertical).So, I know that the device, and hence sensor, Y axis is always in the direction of the earpiece; and the screen Y axis changes when I open the slider.And I know that I can use remapCoordinateSystem() to change the device axes to match the screen axes.But where do I find out what the device's orientation is?In other words, how do I compute the correct values for the X and Y parameters to remapCoordinateSystem()?

Configuration.orientation seems quite useless.Suppose it is set to LANDSCAPE.What does this mean?Does it mean a device which is "naturally" portrait (i.e. the sensor Y axis points to the narrow end), and which has been turned into landscape mode?If so, which way was it turned?Or does it mean a device which is naturally landscape?In other words, LANDSCAPE could mean that the screen axis is off from the sensor axis by +90, 0, OR -90 degrees.Not much help.So how do I do this?Obviously I want my app to work on all devices, not just the G1 phone.

View Replies!   View Related
Android :: How To Write App To Connect Device To Host USB GPS Device
I have a standalone GPS enabled data recorder in my car that can function as either a USB host or device. (Its a class 0x00h USB device). I currently connect to it via a WM 6.5 app running on my Palm Treo 750. I would like to port my WM 6.5 app to an Android phone. (I don't have a specific Android phone in mind, I would like it to be as generic as possible).Replicating the GUI is not that difficult, but I am having trouble getting started on the USB communication. I'd appreciate it if someone could point me towards an example, or the appropriate tutorial.

View Replies!   View Related
Android :: Device Chooser Device Not Showing Up
I'm using the android plugin for eclipse, and when I try to run my program using a real device through the android device chooser, my phone is not listed as a device. I have updated eclipse and all of the android packages, but it still isn't showing up. My phone is running 1.6, which is also the target version listed in the eclipse project.Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas?(using windows 7/t-mobile mytouch 3g)

View Replies!   View Related
Android :: Device Not Showing Up In Device Chooser
Does anybody have an idea what I may be doing wrong. I have installed the usb drivers and have my device running in debugging mode but when I run my basic hello world application through eclipse my device wont show up in the device chooser. I have also tried re installing the sdk and all the drivers and still no luck.

View Replies!   View Related
Sprint HTC Hero :: Device Self Service 1.1 Goes Into Preparing Device
Does anyone know what this program is? What does it do? i launch it, it goes into preparing device and then I am back at home screen.

View Replies!   View Related
Android :: Get Device Manufacturer Or USB Device Id Is there a way to get the device manufacturer or the USB device ID? I could not find anything documented.

View Replies!   View Related
Android :: How To Know Phone Is Going To Sleep
How to know Android Phone is going to sleep? Help me with a sample code.

View Replies!   View Related
Android :: Sleep Mode App?
Is there any kind of app that can block incoming texts and calls, but still allow me to keep my phone on? I'm going to Mexico for vacation, and I dont want a 45378594365 dollar phone bill.

View Replies!   View Related
Android :: Keep WiFi From Going To Sleep?
I'm seeing that some users are downloading data via my application and their connection is dropped because the WiFi is going to sleep. Could I somehow take control over WiFi to keep it alive and once I'm done I return it to it's default state?

View Replies!   View Related
Android :: Sleep Mode In Emulator
Is the actual version of the emulator able to reproduce the sleep mode? (Android 1.1 SDK r_1)

View Replies!   View Related
Android :: App That Changes 3G To 2G In Sleep Mode Like Auto3G
Looking for an app or widget that will automatically disable 3G and change my phone to 3G (Edge) when the screen is asleep or I press the lock button.and the re enables when I unlock.

View Replies!   View Related
Android :: After 30sec Phone Goes Sleep
My problem is or has just started for some reason it was working fine yesterday. When i use my phone and then leave it alone 30 secs it goes into sleep mode and the lock is applied, now before i used to be able to push the menu or home button and the lock screen is displayed to which i can then swipe it down to unlock. This has stopped working all of a sudden, i press home or menu button and the lock screen will not swipe down to unlock the only way i can get into the phone is by pushing menu twice. I liked using the swipe down to unlock it. Is there any reason this has started to happen all of a sudden?

View Replies!   View Related
Android :: Permission Denied For Using Go To Sleep
I wanted to use the funcion goToSleep() in PowerManager Class to force the device to sleep. But I'm getting an exception and the application crashes when I call this function. I already have added the DEVICE_POWER permission in Androidmanifest.xml. When I checked the logs I could see below error "E/AndroidRuntime( 2158): Caused by: java.lang.SecurityException: Neither user 10 020 nor current process has android.permission. DEVICE_POWER." Has anyone faced this issue before. Does application have DEVICE_POWER permission. or is it disabled.

View Replies!   View Related
Android :: Dim Screen - Set To Sleep Programmatically
About 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 Replies!   View Related
Android :: Phone Sleep Function
I previously had a blackberry curve and loved the sleep function where phone would shutoff every night ay 10 and turn itself on at 6:00, is there an app/function for the droid where I can do the same?

View Replies!   View Related
Android :: Does Youmail App Not Let My Phone Sleep?
Why does the youmail app not let my phone sleep? Background: Installed youmail app, realized battery was going FAST. Looked at awake time and it was 100%. Uninstalled all apps since the awake time debacle. awake time returns to normal. Re-install only youmaill app, awake time goes back to 100%. Go into preferences or settings, whatever and set for NO polling at all unless requested, no notifications, nothing. Awake time still 100%.Un-install youmail, awake time back to normal.I really like the app and the widget, someone tell me there is a way to fix this. I would like to re-install and use this app.

View Replies!   View Related
Android :: Sleep Analyzing Application
My first post here, hopefuly, one of many. wi-fi and sleep app I am looking for the same thing. An application that monitors your sleep. It exsist on iphone, and found that pretty nice.

View Replies!   View Related
Android :: Sleep Analyzer Application?
I know they have this for the iPhone. Anything similar for the Android?

View Replies!   View Related
Android :: Way To Let Service Delay / Sleep?
I need to let service sleep for 0.5 sec just as using Thread.sleep(); is there any method??

View Replies!   View Related
Android :: Pause - How To Do A Simple Sleep
How do I do a simple sleep() in Android? e.g. in Perl:

sleep 5;

to sleep for 5 seconds. I have a program that continues scanning wifi until it finds a certain router then plays a tune once found. All works fine, but it scans in 1.6 EXTREMELY fast, where as on 2.0 it scans about once per second. I also made a stop button that does:


But this causes a force close. ? actually every application I have made so far except hello world just gives me a force close. I have checked my permissions in the manifest etc.?I have a soundboard app that cannot play more than 7 sounds before it force closes? why?

Is it my phones hardware?

View Replies!   View Related
Android :: App For Enabling Sleep Mode
I like being able to listen to music as I'm falling asleep never having to shut it off later.Is there like some way to enable like a way for my Android phone to shut itself off at like a specific time?

View Replies!   View Related
Android : Run An App When Phone Is In Sleep Mode?
I'm developping a LiveWallpaper on Android 2.1. This application must download an image every fifteen minutes and draw it on the screen. Everything works except when the phone is in sleep mode. Do you think it is possible to run an application like this when the phone is in sleep mode? And if yes how?

View Replies!   View Related
Samsung Galaxy S :: Make Number Private When Make Calls?
I just got the Samsung Galaxy S Captivate. Seems like a nice phone. Every phone I've had in the past (Nokia, Sony, etc...) has always allowed me to hide my number so that the call display on the receiver's phone shows my call as 'private'. This is useful for when you don't want certain people to have your number when you call. Is there a way to do this on the Galaxy S? I couldn't seem to find any setting how.

View Replies!   View Related
Android :: Keep Activity Running While In Sleep Mode
I have a app that needs to run a command even if the phone goes to sleep. I have it running as a service but it runs randomly when. Is there a way to have the service run even when the phone is sleeping.

View Replies!   View Related
Android :: Sleep Widget For Home Screen
Im 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.

View Replies!   View Related
Android :: Sleep - Screen Behavior Documented
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.

View Replies!   View Related
Android :: Activity Crashing After Waking Up From Sleep
i have an activity that crashes randomly after the device resume from a long period of sleep, the activity is forced to be landscape mode only. When the device resumes from sleep, the activity seems to be redrawing itself in portrait mode, occupying half the horizontal view, then have to force close it.

View Replies!   View Related
Android :: Service Seems To Sleep When Phone Is Inactive
I've written a test service to understand how android implements a service. I believe I understand the difference between Context.startService and Context.bindService. If I am not mistaken, Context.startService will tell android to keep this service running, even after the Activity that started it has ended.

While testing the service, I have come across something interesting.

My problem is that the service appears to sleep or pause for a few hours, run a short time, and then sleep for a few more hours, then run a short time, etc when the phone has become inactive. In other words, when I am doing things on the phone the service is doing what is is supposed to. But after I have finished doing things on the phone and the screen goes blank the service appears to sleep or pause. I don't know if I have implemented the service wrong or if this is how Android services work.

The test service I have written simply sets a postDelayed handler to increment++ a variable in the Runnable every minute, and then write the value of that variable and a timestamp to a file (log.txt) on the sd card. This how I know that the service appears to sleep. Because there are gaps in the timestamp that correspond to when the phone was inactive. If the service were truly active the whole time, there should be a line item in the log.txt file every minute.

From the log.txt file below you can see that over an eleven hour period there are only 36 line items with time stamps ranging from 10:27 PM through 9:23 AM. If the service was running and active the whole time there should be over 600 lines in the text file. The phone was on AC power the whole time so Android should not have tried to stop services due to power issues. The phone was not used or touched from about midnight to 9 the next morning, so there should not have been a low resource clean up.

I have spent several days looking for an answer and everything I can find seems to validate that when a service is started and not bound, it will stay running ( app/Service.html). However, it appears it does not. Unless I have completely missed the ball on this.

I have included the and as well as the log file.

Here is a sample log.txt


Here is the service java file:



View Replies!   View Related
Android :: Check Phone Sleep Status
I'm trying to check if the phone is currently asleep in a service. It's currently a very messy implementation (I'm reading a file in the filesystem that says if the phone is asleep or awake every 10 seconds) so I'm wondering if this is possible with PowerManager or something.

View Replies!   View Related
Android :: Sleep Mode - Technical Documentation?
I'm trying to find some official android documentation that discusses sleep mode, with a focus on issues that might be of relevance to app developers. For example, things like:

1. What causes a device to enter / exit sleep mode?
2. How are running processes impacted when the device enters sleep mode? (I believe they continue to exist, but don't execute because cpu activity is suspended.When the device wakes up execution picks up where it left off?)

There is some good info in the API docs for PowerManager and WakeLock, but nothing there that explicitly states what I have assumed in point 2 above. Are the above issues (and any other relevant issues) documented anywhere?

View Replies!   View Related
Android :: Disabling Screen Sleep Programmatically?
how to prevent the Android Activity from sleep mode programatically. Or can we declare something related to this in Android Manifest file.

View Replies!   View Related
Android :: Network Access When Phone Sleep
I'm using a combination of alarm (set with AlarmManager) and background service to periodically synchronize data in my application. The only problem I have is that when sleep policy terminates Wi-Fi connection the synchronization no longer works. Is there a way to "wake up" the Wi-Fi connection that has been put to sleep? GMail somehow manages to do that because it notifies me about new e-mail even if the phone entered sleep mode.

View Replies!   View Related
Android :: GPS Location Updates When The Cellphone Is In Sleep?
I need to update the location through GPS in the background even when the phone is in sleep. I am thinking to use AlarmManager to broadcast an Intent and then a receiver will call requestLocationUpdates() on LocationManager. But I am not sure whether it's guaranteed that the GPS location will be updated when the phone is in sleep and an intent will be broadcasted if I registered a PendingIntent when call requestLocationUpdates()?

View Replies!   View Related
Android :: Droid Air - Keep Application Alive During Sleep?
If it is possible to keep an Air for Android application alive during sleep, how can it be done? I know how to prevent sleep and lock but this course is not preferable to some users.


The reason in this case is to keep the video streaming from the phone to a server.

View Replies!   View Related
Android :: App That Can Turn Off Wifi Whenever Put Phone To Sleep?
Is there an app that can turn off my wifi whenever I put my phone to sleep? To conserve battery, I always have to turn off my wifi before I turn it off, and turn it back on when I unlock it. After a few days of this, it gets pretty annoying. I'm used to the iPod touch where when you sleep it, the wifi automatically turns off to save battery,and when you unlock it, and turns it back on. It would really save me the time.

Also I noticed this Wifi sleep policy thing. I don't really understand, can someone elaborate or explain more. Is it that when your not using your wifi for +15 min, it automatically turns off? Do you turn it on manually, or does it do it auto when you starting using wifi programs like browser.

View Replies!   View Related
Copyright 2005-08, All rights reserved