Android :: Service Application Not Working In Sleep Mode
Jan 26, 2010
I am using a service in my app. But it doesn't seem to work in sleep mode. I have implemented startforeground to prevent it from shutting down but it still does. Following is my code.............................
View 4 Replies
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
Feb 18, 2009
the thread sleeped not killed and it wakes up after 10 sec and try to post message and it causes exception. is there any way to kill the threads those are in sleep mode while exiting the application?
View 5 Replies
View Related
Aug 1, 2010
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 4 Replies
View Related
Apr 6, 2009
Is the actual version of the emulator able to reproduce the sleep mode? (Android 1.1 SDK r_1)
View 3 Replies
View Related
Aug 30, 2010
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 8 Replies
View Related
Jul 25, 2010
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 1 Replies
View Related
Jun 1, 2010
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 3 Replies
View Related
Sep 24, 2010
I need to let service sleep for 0.5 sec just as using Thread.sleep(); is there any method??
View 1 Replies
View Related
Jan 20, 2010
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 3 Replies
View Related
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
Jun 23, 2010
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 3 Replies
View Related
May 17, 2014
I'm really not "using" my Android S3 phone all day long, it gets frustrating when the bettery runs at 30% at 2pm, without any real use.
So the concept would be:
1) either a "ROM" of Android, which would be seriously minimal - like the device is not a smartphone - so only wake up on incoming call or text message
2) or an app, which does the same thing - suspends the phone completely, and wakes it up only on the incoming call or text message
I was just curious - does something like this exist? I don't care about apps, notifications, wifi or sync, I was thinking more along the lines of would it be possible to use your smartphone like a typical "cell phone", and when you need other apps or full features (GPS navigation with maps, or Shazam, or whatever it is you need) - you just "reboot" or do a quick switch to "full Android" mode, and use those features.
I feel that the battery life should be at least 5 days in that mode, with light usage?
View 3 Replies
View Related
Feb 7, 2009
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 (http://code.google.com/android/reference/android/ app/Service.html). However, it appears it does not. Unless I have completely missed the ball on this.
I have included the service.java and activity.java as well as the log file.
Here is a sample log.txt
CODE:...............
Here is the service java file:
Java:
CODE:....................
View 5 Replies
View Related
Mar 1, 2010
Is there any way to detect whether an android phone is in sleep mode (screen is black) in the code?I wrote a home screen widget. I don't want the widget gets updated when the screen is black to save the battery consumption.
View 1 Replies
View Related
Oct 6, 2010
I have a service which polls a server at certain intervals. I use an AlarmManager and a BroadcastReceiver to start the service. My problem is that after a certain duration, even though the WiFi is still enabled, but for some reason, my application can't contact the server. I get an "Unreachable network" error. Note that I've already acquired a partial wake lock as well as a wifilock. Here's my code for the BroadcastReceiver.
public class ServiceAlarmBroadcastReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
WakeLock wakeLock = null; WifiLock wifiLock = null;
try { PowerManager pm = (PowerManager) context .getSystemService(Context.POWER_SERVICE);
// acquire a WakeLock to keep the CPU running
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MyWakeLock");
if(!wakeLock.isHeld()){ wakeLock.acquire();
} Log.i("ServiceAlarmBroadcastReceiver", "WakeLock acquired!");
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
wifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL , "MyWifiLock");
if(!wifiLock.isHeld()){ wifiLock.acquire();
} Log.i("ServiceAlarmBroadcastReceiver", "WifiLock acquired!");
context.startService(new Intent(context, ThePollerService.class));
} finally { // release the WakeLock to allow CPU to sleep
if (wakeLock != null) { if (wakeLock.isHeld()) {
wakeLock.release(); Log.i("ServiceAlarmBroadcastReceiver", "WakeLock released!");
} } // release the WifiLock if (wifiLock != null) { if (wifiLock.isHeld()) { wifiLock.release();
Log.i("ServiceAlarmBroadcastReceiver", "WiFi Lock released!"); } } } } }
View 2 Replies
View Related
Jul 8, 2010
I just got an evo a couple weeks ago. I love the phone, but after I downloaded the OTA, it won't go into sleep mode. I've turn off all the syncing, tried task killers, tried stopping google talk, the calender, everything I have read in forums.I am thinking my only choice may be to root, but I wanted to see if anyone else had this problem and if anyone actually got it fixed.I really don't want to risk bricking my phone if I don't have to..
View 4 Replies
View Related
Jun 17, 2010
So, I have left my almost fully charged Evo on my nightstand the past couple of nights without plugging it in, and when I wake up in the morning, my battery is almost fully drained. One night I did have the 4G on, but the other night I did not. Is there some sort of setting or sleep mode so it doesnt drain the battery when I am asleep?
View 3 Replies
View Related
Sep 21, 2009
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 Related
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
Sep 10, 2010
Have an iPhone and part rely on it for diction and recordings. However a new software upgrade has meant when it's recording it tells you on the home screen if you press the button to wake it up, even if locked. Does the android have voice recording in sleep mode and if so does it do so without it stating it on the screen?
View 2 Replies
View Related
Dec 28, 2009
I have code that runs in the background and holds a connected Socket and it's InputStream.It calls read() infinitely until something is received, then continues to parse.Socket timeout is 0 of course.I am interested in what would happen when the device goes to sleep?Is the CPU off? Will this socket be responsive in this case?
View 2 Replies
View Related
May 16, 2010
As the phone sits idle, the screen goes black. In order to use the phone again you must hit the power button, then slide down on the screen or hit menu. Is there anyway to remove the phone from sleep other than hitting the power button? I find this incredibly annoying that I can't just tap the screen then slide down. Are there any other options for removing it from sleep mode and if so where would I change it?
View 2 Replies
View Related
Oct 27, 2009
Over the last week or so I've been obsessed with trying to get my hero into sleep mode, in order to save battery. For those who don't know about this, there are many threads around the net telling of a fix for the messages bug, which prevents the phone entering sleep. It's supposed to reduce CPU usage, thus saving battery.
Now, I've followed the methods of many people who claim to have done this successfully, down to a tee, but for the life of me, I can't get it to work. For some reason my awake time is always at 100%. It's now at the pont of driving me mad, and I'm just wondering if anyone else has tried and failed to do the fix. If anyone needs background info on this problem, I'll post a link up later, as I'm sending this via my phone at the minute.
View 13 Replies
View Related
Jul 26, 2010
I have just got my HTC desire. And i cant stand that i have to press the power button to get out of sleep mode to show the lock screen. wish i could just press menu/home or any of the buttons but the power one right at the top. I only say this as i swear my htc tattoo unlocked in this way. if not this could get quite annoying. So is there anyway to change this. I have tried looking through settings but i have a bad feeling you cant change it.
View 3 Replies
View Related
May 26, 2010
Recently moved from a very old Nokia into the 21st century and got a hero last week. Of course i cant stop playing with it and love it, but i may have altered some settings which i wonder if anyone can help me with;before, when the phone was on and i pressed the power button once, it went into sleep mode. Now it doesn't. Any ideas why?the alarm on the clock is silent. Obviously a bit of a problem in the mornings! Any idea why?
View 1 Replies
View Related
Aug 30, 2010
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 3 Replies
View Related
Sep 29, 2010
I just bought the phone, and have been charging it for a half hour or so, and it keeps shutting off(or going in sleep mode) while I am trying to set it up.
My first thought is that it needs to charge; I admit, I barely let it charge right out of the box because I am so anxious to use it. Is that the issue? I assumed that even if the batter is at 5-10%, shouldn't it work without issue if it is plugged in to the wall and charging? I will let it charge another hour or so, but I just cannot wait to get my hands on it.
View 5 Replies
View Related
Jun 4, 2010
I installed juice defender this morning then deciding i didnt want it i uninstalled it, since then my wifi keeps going into sleep mode after about 15 mins which i dont want. before i installed juice defender it just stayed on all the time so i got notifications etc. ive reinstalled juice defender and disabled all its features as far as im aware but wifi is still going into sleep mode. what can i do to get my wifi back on all the time.
View 4 Replies
View Related
Jun 14, 2012
I have a smartq t20 tablet (great cheap tablet!) running ICS, my question is, when I leave wifi on all the time, what happens when the tablet goes to sleep (not awake according to the battery details)?I can leave a download running and it would continue when the screen is off, does this mean my tablet is never going into deep sleep? Or is that unrelated?
I know the wifi itself drains more battery when left on even if it isn't being utilized but I was wondering about the CPU side of it.
View 3 Replies
View Related