Android :: Make Sure Service Is Restarted?
Aug 31, 2010
I have an Android application with a background running Service. When the Service crashes or gets killed by Android I can see that Android tries to restart it again. However the Service never actually restarts, I can see Android scheduling the restart but it new actually happens.
My code is as follows:.................
View 1 Replies
Sep 10, 2010
From what I can tell -- if you return START_NOT_STICKY from Service.onStartCommand(...), the system should not restart a service if it crashes. However, I'm not seeing that behavior -- any ideas on what could be restarting the service?
View 4 Replies
View Related
Jul 25, 2009
I have a service that needs to hold a persistent TCP connection, think IM. I'm reluctant to use setForeground() - the service being down temporarily isn't that big a deal, and I am assume I can trust that I'll be run again once memory is available, correct? The problem here is this. The service was started via startService() before being killed. However, when it is restarted, only onCreate() is executed. This makes it hard to continue, because starting work onCreate() means I can't even bind to the service (to say query it's status) without it doing so. Is this a bug or per design? What is the status of the service after it is being restarted? Is it consider "started" by the system, i.e. waiting for a call to stopService()?
View 2 Replies
View Related
Jun 25, 2010
This is where it gets weird. When I tried to call out from my DINC, it would start dialing, then simply stop and say "call ended". During this apparent outage, CityID (worst crapware ever!) reactivated itself after a month and a half of being done with my trial (got the DINC on 4/29). Even though my calls weren't going through, CityID was identifying the location of the numbers I was trying to call.
After a couple hours, service resumed, everything was fine and CityID stopped working again (thankfully). When I go to my call history, all the numbers that I tried to call during that time have the city and state information from CityID. All the numbers before and after do not? Weird! I thought after the two week trial it was supposed to go dormant? I hope it never reactivates again as it has never, not once, been correct regarding the location of the number calling.
View 2 Replies
View Related
Mar 31, 2009
I have noticed that if my background service crashes the system will automatically restart the service after 5 seconds. This is great, but I have noticed that only the onCreate method gets called and not the onStart method. Does this mean the service is properly restarted or do I need to do something special in the onCreate method to make sure it is? I did have my initialisation logic in the onCreate method and my starting service logic in the onStart method but it looks like it will all have to be in the onCreate method.
View 2 Replies
View Related
Nov 1, 2010
Suppose you have a download service that downloads files asynchronously. For each download intent received it will put the URL of the file to download and the start ID into a job queue and return START_REDELIVER_INTENT. A worker thread then processes that list and calls stopSelf with the start ID it just processed. My question is: If the service's process gets killed and the service restarted, will the service receive all the intents (with the URLs) it hasn't called stopSelf on before it was killed or does the service receive the last intent only? It seems the API docs are ambiguous on this.
The docs say
"if this service's process is killed while it is started [...], then it will be scheduled for a restart and the last delivered Intent re- delivered to it again [...]", indicating that only the last intent gets redelivered (which would be terrible in this use case), but they also say "The service will [...] be re-started if it is not finished processing all Intents sent to it (and any such pending events will be delivered at the point of restart)."
View 4 Replies
View Related
Sep 26, 2010
How do some android app make their service restart even if killed from task manager? A good example is Lookout security app. What I guess is that it has registered for all common events that are announced like app installed unistalled, interenet available ,etc.Is this a way to keep your service running ?Another solution I found was to make 2 services monitoring each other, so if one gets killed restart another.Which one would be a proper approach? Is there any way in android to start booting automatically(if device is switched off) once connected to power source? I have never heard this on mobile platform.This is possible for PC through bios feature. Can it be done on android?
View 1 Replies
View Related
Apr 9, 2010
I'm trying to create a service that can run in backgroud. To start this service i'm using a activity to invoke startservice() API. This will start the service but when i exit the activity by invoking finish() and system.exit(), I see that service created/started by the activity is also terminated.How can i make sure service runs indefinitely even after terminating activity that started the service?
View 2 Replies
View Related
Jun 30, 2009
How do I make my service always alive?? If my service gets killed because of an exception or if the VM kills my service on low memory, How do I make sure that my service is always running?
View 14 Replies
View Related
Dec 11, 2009
I start a service in an activity then I want the service to stop itself after awhile.
I called stopSelf() in the service but it doesn't work.
how to make the service stop itself?
View 3 Replies
View Related
May 21, 2010
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 1 Replies
View Related
Sep 30, 2010
I have developed an android service. Any android app can use it's API's to get some kind of news updates from this service. I want to distribute this service so that any android app on the phone can use this service. My questions here are :When some android application try to use its API on the phone and suppose that service is not available on the phone then what will happen ?How will android application developer will make sure that the service is available on the phone?Does application developer has to bundle service with his application ? If yes then wont be there multiple instances of same service on phone if multiple application contains same service on the phone?
View 1 Replies
View Related
Jun 5, 2010
I want make an app/service that looks like (Nexus One touch buttons) for the navigation keys (Home, menu,Back, Search). The buttons should always stay on top and send the command to the actually app thats running. Someone have ideas and sample codes how to do that?
View 3 Replies
View Related
Jan 18, 2010
Can anybody tell about the Broadcast Receiver in android to make make my service to run when the the phone just finishes the booting.
View 5 Replies
View Related
Aug 16, 2010
I know on screen orientation changes activity restarted, but suppose i don't want to restart the activity then what should I do? I had tried it by adding in manifest.xml. android:configChanges="keyboardHidden|orientation"
and override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); }
But still activity restarted each time when I change screen orientation.
View 17 Replies
View Related
Nov 17, 2010
I have an activity (say activity A) which displays video using a mediaplayer, rendered in a surfaceview.
The use case is to pause the video, start another activity (say activity B), then come back to activity A.
Activity A is stopped but not destroyed when going to B, which is good.
The surface view (since not visibile) IS destroyed (as observed from the notification callbacks). When coming back to activity A, and restarting the mediaplayer using start(), the media player does play back the audio, but video is not seen. Errors like this one are output on Logcat:
CODE;......
Unfortunately, using the new instance of SurfaceHolder as provided by surfaceCreated() doesn't help (i.e. provides the same error).
I have read in various posts a solution would be to reset the mediaplayer and restart it completely, however it is not efficient, as the end user would have to wait for the whole player preparation cycle + seekTo last position within the stream.
As shown with the fact the audio plays back, it should be a matter of plumbing between the the video decoder and the new surfaceholder/view.
What should be the best solution (best = fastest) to resume video playback when resuming the activity?
View 3 Replies
View Related
Apr 10, 2009
I have a long lived service, it wakes up (via the AlarmManager) at intervals and connects to a web server. If the phone goes to sleep and one of my polling intervals happens the phone wakes up enough to let me attempt to connect to the network but the ConnectionManager claims there is no network. Given the system log this is correct, it was torn down. Pushing "Menu" once is enough to get the network back up and then my service can connect. How do I get the network to reconstruct itself?
View 2 Replies
View Related
Sep 8, 2010
I want my application to be started whenever the phone is turned on or restarted.
View 1 Replies
View Related
Dec 22, 2009
I had a weird issue that has sprung up twice now with making phone calls and I wanted to see if anyone else was experiencing the same thing. Visually everything looks like it is functional with my phone service on the phone. I have bars, nothing out of the ordinary. However, I can't make any outbound calls either through my contacts or by manually dialing. I the number pad and it makes the response noise but doesn't actually type the number. In contacts, I hit call and the same thing happens. The fix I have found is just to soft boot the phone. Now I hear you all saying "No big deal, just restart." Yeah, it is no big deal unless I have to make a call in an emergency say calling 911 or things of that nature. Waiting for 5 minutes for my phone to reboot in an emergency can cost lives. I know I am being a little dramatic, but c'mon, at the end of the day, it is a phone and it is having trouble making calls.
View 2 Replies
View Related
Oct 12, 2010
I just ran across the 'PAW Server' app and it's pretty neat so far. I don't want to use it with http though, so I enabled https and restarted the app. It doesn't work at all now. I enabled bluetooth so I could manually update the config file on the sdcard and restart the server in http mode. It instantly started working again. I've tried a couple of different ports but can't get the https mode to work at all. The docs say that it will be slower which is understandable, but since it's not working at all I have to assume that I'm doing something wrong and missing something obvious. Anyone else using the PAW Server app with https enabled?
View 3 Replies
View Related
May 10, 2010
I was on this very forum typing a reply using Uber Keyboard. I was using dolphin. All of a sudden the options screen for Uber Keyboard (BTW, I don't like it anymore. only got it for the speech to text feature) popped up and kindof self navigated to a deeper menu. I tried using the back button. This cause all of the buttons/keys to light up full brightness and then the screen went black, but the keys stayed lit. I tried pressing the end key but nothing happened. Then all of a sudden the the Android and Verizon splash logo's came up (very fast, not anywhere near as long as when you power on the phone). The phone came back to a normal state as it usually does from a power on and everything is fine.
View 2 Replies
View Related
Jun 14, 2010
I was sending a text using the shapewriter keyboard and was trying to put it to landscape mode when it wouldn't react...i was trying to press back and the phone wouldn't respond and then all of a sudden it just restarted on me...on top of that once the phone restarted I was trying to turn on 4G but I couldn't even get the option to be available...it looked as though it was blacked out while I had no problem turning on everything else...here is a screenshot...
I had to restart the phone in order for 4G to become available again...since then shapewriter has constantly "force close" on me...I don't know if that is the issue since I just installed it today Should I take the phone back because it just randomly restarted on me and the 4G wouldn't work? Anyone else have this happen to them?
View 2 Replies
View Related
Oct 27, 2010
I got an Xperia X8 on 22nd October. The phone is very good to use. Its touch response is perfect. The speed is good. But the phone restarted the first day when I played the demo video. Within 5 days the phone has restarted for about 4 times when I was playing other videos. How to get rid of this problem?
View 2 Replies
View Related
Aug 31, 2010
I was sitting at my work desk and my phone restarted itself out of nowhere. No updating was done, I was at 55% battery and it wasn't even touched. I was at my desk for about 30 minutes straight, it's laying face up and I saw the phone restart.
View 23 Replies
View Related
Jul 19, 2010
Yesterday I got notice that an update was avail on my Ally, but wife didn't get the message(?) so I accepted the update but was low on battery. I connected to a charger. Walked away as it was taking a wile. Forgot about it and today its acting all kind of crazy! everytime I press menu the camera pops up or it restarts! I checked and it still shows 2.1 update 1 in the phone info. Took a few times to get to it as everytime I tried to check it the phone restarted. I want to backup my messages and reformat it and see if it helps! Anyone know of a good app to backup the phone with?
View 1 Replies
View Related
May 15, 2010
This is my first ever smart phone and android phone so excuse me if this is a silly question! I've noticed that after closing the web browser (well hitting the home key as there is no obvious exit option) and then re-opening it, the browser shows the page I was last at which makes me wonder if it's still running in the background and consuming battery (same with the PDF viewer). Am I right in thinking this and if so how do I close it?
View 3 Replies
View Related
May 25, 2010
I just did a *228 and my phone had an on screen notification (not in the bar) that said something about OTA, and my phone restarted.
View 16 Replies
View Related
Sep 22, 2010
This morning my phone randomly restarted while I was browsing the internet. When I restarted it, my 3G had disappeared Icon and actual service.
View 1 Replies
View Related
Nov 20, 2010
I recently bought X1-mini, from the day 1 onwards, while opening the camera the phone was getting restarted (its happening sometimes)...Can anybody having this problem, i'm using Adroid2.1 update.
View 1 Replies
View Related
Oct 30, 2010
My X8 was getting restarted when try to play a video. It was also getting restarted while playing the video shoted with that Own X8's cam. I updated the S/W but no use of it. Whats the reason for it. Is there any solution.
View 3 Replies
View Related