Android :: Putting Device To Sleep And Wake Up Programmatically?

May 23, 2009

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.

Android :: Putting Device to Sleep and Wake Up Programmatically?


ADVERTISEMENT

HTC Droid Eris :: Putting Phone Into Sleep Mode With Dedicated Key?

Feb 23, 2010

I know this is going to sound dumb but how do I put the eris into sleep without not touching it? like the droid has a dedicated key at the top which is also the power key so how do I do it for the eris?

View 1 Replies View Related

Android :: Best Way To Schedule An Event That Will Wake Up Phone / Goes Into Sleep Mode?

Mar 2, 2010

I was investigating the issue of setting up a delayed activity/event, that will occur and trigger even if the phone is in sleep mode (wake up, do what you need to do, go back to sleep). I was thinking of the following methods: 1. sendMessageDelayed 2. Timer 3. AlarmManager.The basic requirement is to be able to set a triger in the future, and be sure that this trigger wakes up the system if it is sleeping,perform the task, and go back to sleep.A partial wakup is required (no screen flickering). Currently i'm using the sendMessageDelayed, and i keep a wake lock held for the timeout period (bad practice).

View 8 Replies View Related

HTC Desire :: Way To Use Trackpad Sleep Wake?

Sep 28, 2010

is there any way to use the trackpad to wake the phone instead of the button on the top?

View 12 Replies View Related

HTC Incredible :: Screen Wont Wake After Sleep

Apr 30, 2010

Anyone else having this issue with there Incredible? If i hit the sleep button to shut off the screen it will wake up when i hit it again. If i just let the screen time out it wont wake back up, but the touch buttons buzz but screen wont wake

View 9 Replies View Related

HTC Wildfire :: Handset Crashing / Won't Wake From Sleep

Jul 19, 2010

my wildfire has been fine up until a couple of days ago.Intermittently whilst its sleeping it gets stuck in sleep mode! and will not wake, i have to remove the battery and boot it up from scratch, is there an error log i can check to see what's killing it?and before anyone asks, the battery was full

View 6 Replies View Related

Android :: Dim Screen - Set To Sleep Programmatically

Dec 23, 2009

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 2 Replies View Related

Android :: Disabling Screen Sleep Programmatically?

Nov 24, 2010

how to prevent the Android Activity from sleep mode programatically. Or can we declare something related to this in Android Manifest file.

View 2 Replies View Related

Samsung Captivate :: WiFi - Sleep Policy Causing Wake Lock For Android System Process And Draining Battery

Dec 1, 2010

After noticing my battery was draining quickly, and then after reading this thread, I installed Android System Info to see what was draining my battery so fast. I notice that whenever I would turn on WiFi, the phone will never go to sleep , regardless of what I set the WiFi sleep policy to. After turning off WiFi, the battery still drains heavily.

The WiFi will shut off after 15mins (if you set it to "When screen turns off" or "never when plugged in"). However it seems to keep the CPU on causing it to drain down the battery.

It would seem that whenever WiFi is enabled, the Android system process creates a partial wakelock that does not go away even if you turn off WiFi. The only way to resolve this is by powering off or rebooting the phone.

You can verify this in Android System Info by going into Battery-History-Other Usage-Partial Wake usage to see how much time the "Android System" process holding a partial wake.

I even did a factory reset on the device; and it is still happening so it doesn't appear to be any app that caused the issue. As I said, it works fine as long as I don't enable WiFi.

I already know of two users having this issue, but I'm wondering if folks having battery problems are going through this as well. Is anyone else having similar issues after using WiFi? I'm hoping someone will be able to identify what exactly is putting the wakelock on and we'll be able to find a fix for it. Other than not using WiFi at all or rebooting the phone after using Wifi.

View 17 Replies View Related

HTC Eris :: Putting Music On Device Via USB

Dec 23, 2009

I recently got a Droid Eris and I'm trying to figure out how to put music on it from my laptop via USB connection. I've unmounted and remounted the SD card, but I still get no window or anything popping up on the laptop. The only indication of the device being on the computer is the 'Safely Remove Hardware' icon at the bottom status bar.

View 23 Replies View Related

Android :: Wake Up The Device By Code

Aug 6, 2009

I have an application with notification. I want my notification can wake the device up when it goes off but the device is asleep. Could anybody tell me how to do by some code?

View 4 Replies View Related

HTC Incredible : After Putting The Sd Card The Device Still Doesnt Recognize It

May 12, 2010

I got my HTC incredible 2 days ago. When I first got it it had no sd card, so i went back to the store and the guy gave me one. But even after putting the sd card in the device the device still doesnt recognize it. When I go to the settings and click on sd card and phone storage under sd card it says, total space: unavailable, available space: unavailable. this is a major problem cause now i cant download files or use several applications or features. ive tried taking it out and putting it back in, restarting the phone, and formatting the sd card to no avail. i'm no tech expert, but pretty tech savvy. This problem, though, has me pulling my hair out. it seems like a lot of ppl have been having the same problem, but no one has any answer that seems to be working. im going to the store tomorrow to see if its a problem with the sd card, but wanted to check if it was a problem with the phone or if anyone else has had the same problem.

View 3 Replies View Related

Android :: Wake Droid Device Up At A Certain Time?

Sep 1, 2010

I need to wake my sleeping android device up at a certain time.
Any suggestions?

P.S. Wake up: turn display on and maybe unlock phone

View 3 Replies View Related

HTC EVO 4G :: How Inadvertently Solved Wake-time / Sleep-time Trouble On Evo?

Aug 7, 2010

I was having the waketime/sleeptime problem that many, many folks have reported and my battery life was obviously crap...and took forever to charge as has also been noted. I had already turned off all the auto-update stuff that I did when I first got the phone. Then I read the many posts abut Facebook app being the problem, but when I tried that it turned out that I was still running the old version 1.2, so apparently that wasnt causing it on my Evo.

Not really wanting to do a factory reset, I thought I'd check for other app updates in case one of the other apps had 2.2 bug fixes. Ran a sync thru the AppBrain app, and it found three updates that I hadnt been notified of:

Once those updates were completed, my EVO immediately starting going to sleep as it used to. I watched it for a few hours after the update and it continued to show realistic numbers for wake vs. sleep. My battery was almost depleted at this point, so I powered it off, and did the battery pull for good measure before powering back on and plugging in to charge during the night. This was all late Thursday night. All day Friday my battery performed VERY well...much better than even during 2.1. I had it on charge most of the day while listening to Pandora at my desk. I unplugged it to go home and now checking it this morning, it's now been off charge for 14h 39m, show wake time of 33:44 vs. sleep time of 15:28, and shows 80% battery remaining! This whole scenario makes me wonder if one of those three apps had a similar bug to Facebook. If you have those...you might want to take a closer look.

View 1 Replies View Related

Android :: Possible To Wake The Device With - PowerManager.WakeLock.acquire

Jun 16, 2010

I have a timer that schedule a task to run every 5 minutes. This task send a request to a server, so I need to be sure that CPU is on so that wifi or 3g can be used.

So the first thing I do in my run() method is :

CODE:.........

And the last thing I do in the run() is : wl.release() ;

I would like not to release here to be sure my service will run in the next 5 minutes :

The question is : if the device is already in a sleep state, can I wake up it with my wl.acquire() ?

View 3 Replies View Related

Android :: How To Make Device To Sleep?

Jul 20, 2009

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 5 Replies View Related

Android :: How To Find Out If Device Is In Sleep Mode?

May 26, 2009

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 3 Replies View Related

Android :: How Can We Get Device Name Programmatically?

Sep 5, 2010

On Sun, Sep 5, 2010 at 12:55 PM, Vipul <vipulpancha...@gmail.com> wrote: > I want to get the name of device programmatically. > Suppose anyone has set the device name as "My New Phone"> I want to get that.

View 3 Replies View Related

Motorola Droid X :: Hardware Buttons For Wake Device

Jul 15, 2010

I just am wanting to know if one (or more) of the four hardware buttons can wake the device. My impresssion is yes but I need to know for certain.

View 3 Replies View Related

Android :: Determining If Device Is Rooted Programmatically?

Aug 6, 2010

How do you determine (programatically) if an Android device is: rooted Running a cracked copy of your software or rom. I have some sensitive information in my database, and I would like to encrypt it when the phone is rooted aka the user has access to the database. How do I detect that?

View 2 Replies View Related

Android :: Programmatically Install Files On Device

Jul 22, 2010

Let's say I have 2 files on Desktop: (Note that I have another file than .apk application.)

.apk file
.zip file (wich contains a large of data that .apk must unizp and do some work with it).

I want to plug an Android device and programmatically copy these both files to Android.

The application must be visible to user and the .zip file must be "visible" to the application, wich will unzip it and do some work with it.

With PalmOS, I use HotSync API. With WinMobile I use ActiveSync (rapi) API. How to do it on Android?

View 1 Replies View Related

Android :: Way To Get IMEI Number Of Droid Device Programmatically

Feb 10, 2009

I want get the IMEI number of a android device programmatically. But I don't know how to get it by writing a program.

View 2 Replies View Related

Android :: Programmatically Disable / Enable Notification Led On Phone Device?

Jul 22, 2010

Is it possible to programmatically disable and enable the led indicator light on an Android device? I am not referring to just turning it on and off as in a notification. I did not see anything in the api that would do so. I am guessing this is hardware specific if it is possible at all.

View 1 Replies View Related

Android :: Programmatically Perform A Factory Reset On Droid Device?

Mar 19, 2010

Understanding how incredibly dangerous this question is, I'd like to know if it is possible to programmatically issue a factory reset, as available in Droid and G1. Does anyone know how this is implemented? Is this implemented using the standard Android SDK, a Motorola-specific function, or something else?

View 1 Replies View Related

Android :: Retrieve Files Or Audio Files Programmatically From Device

May 11, 2010

I want to know how to get the ringtone,audio files in the device and I want set them as alarm. I am working in the code to set the alarm and I want to know how to retreive audio or ringtones from the device.

View 1 Replies View Related

HTC Droid Eris :: Auto-rotation From Sleep Mode / Delay In Waking From Sleep Mode

Jan 5, 2010

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 5 Replies View Related

Android :: Putting Data In SMS Sent Intent?

Dec 30, 2009

I'd like to send an sms message. If the text is too long, I split it into multiple messages. I'm trying to put some extra info into the "sent" intent to know which part has been sent, and when all the parts are complete: The message is sent, and I catch the intent when each part is sent - but the intent always has the same data in it. For example, "partIndex" is always zero, even though for the second message, it should be one. Seems like the same intent just keeps getting thrown to my broadcast receiver. What's the right way to do this?

View 1 Replies View Related

Android :: Putting Views On Top Of Other View

Feb 9, 2010

I'm still trying to figure out how best to layer views on top of other views. I want to do something like the ZoomButtons on top of a custom view. I tried getting the ZoomButtonsController's parent and then adding views, but I didn't have enough control and they ended up on top of the buttons. I've gotten close by using a FrameLayout and some gravity on the top two views. But this has some interesting effects. Since this is contained with a tab, these two top views appear on top of all four of the tab pages. I want them on top of one of those pages only. Apparently, nested FrameLayouts don't mix well. What is the proper and expected way to do this? Here is more or less my complete layout....................

View 4 Replies View Related

Android :: Putting App For Testing On My Dev Phone

Jan 29, 2009

I have gotten through signing up as an Android developer, joined Android Market, and recieved and activated my Android Developer Phone.I have my first draft application running in the emulator.The documentation suggests testing it throughly on the device, however, I don't want to put it up publicly in the Android Market until I am satisfied with the app.

1) Is there a way to privately post a testing app on Android Market? If so, would somebody please point this newbie to the HOW-TO?

2) Is there a way to push my app onto my developer phone without using Android Market? If so, would somebody please point this newbie to the HOW-TO?

I'm having more fun working with this Android stuff than I have had in years! As soon as I learn enough to contribute I'm going to be overjoyed to share it.

View 5 Replies View Related

Android :: Putting Serializable Classes Into SQL?

May 4, 2010

I have a bunch of objects that implement Serializable that I want to store in a SQL database.

I have two questions:

Is there a way to serialize the object directly into the database. Is that the best way to do it or should I Write the object out to a formatting String and put it in the database that way and then parse it back out
Write each member to the database with a field that is unique to each object.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved