Android :: Saving Service Killing Without StartForeground

Nov 20, 2009

I am running a background Android Service as VoIP Framework which provides different VoIP services to different Android applications, (VoIP call, Video Call, etc). The service establishes a network connection with the Server(Service Provider) and does some initial handshake before it can start providing service to the Android applications, that's why though of starting the service on BOOT_COMPLETED event.

The problem is when the service gets started on BOOT_COMPLETED event, before even it finishes the initial network connection with server and handshaking, it gets killed by the system. I have tried using setForeground which improves the behavior a bit but still gets killed mid-way. I am working with old version 1.5 r3 of SDK and hence, cannot use "startForeground". Is there a way out or another alternative available with SDK 1.5 r3?

Android :: Saving service killing without startForeground


Android :: Service.startForeground() Messes With Scheduling?

Apr 8, 2010

I updated my app to use the "new" startForeground() method of Service. Now beta testers are complaining about the foreground app going slow. Is that a coincidence or does startForeground() mess with the thread's prio or does anything else but what is written below? Just as an additional information the background activity does some syncing, reports the progress to the notification using remote views and as it is not latency dependent I use (and did that before already) this: Process.setThreadPriority(Process.THREAD_PRIORITY_LOWEST);

Should I use another Priority? And if it makes any difference, how does that play with Android 1.5 devices?

View 13 Replies View Related

Android :: Saving CookieStore In Http Client Service

Feb 9, 2010

I have a Service for my Android app that performs HTTP calls. The Service stores cookies in a CookieStore. I am trying to find a way to persist the CookieStore but I haven't been successful. I don't want the user to log in every time to receive a new CookieStore.

I tried to use SharedPreferences to store the CookieStore as a string, but I can't re-construct the CookieStore with a String.

Has anyone else had success in persisting a CookieStore?

View 1 Replies View Related

Android :: StartForeground() Broken On Incredible

May 24, 2010

It seems that on the Incredible the startForeground() call is non- functional, causing my process to be put into the background scheduler class even though it has an active ongoing notification. I'm calling it the same as on other 2.x devices (through reflection as suggested by Diane for backward-compatibility), and this works fine on the Droid, with the same OS level (2.1-update1). I can see in the debugger that it gets all the way to ActivityManagerNative.setServiceForeground() with the notification param being non-null, so it's got to be in the ActivityManager or below.

The really telling thing is that the stock music player acts the same way. When I'm playing a song and go to the home screen the com.htc.music process goes into the bg class, even though its notification is still active. This is a real problem for us, as it denies us the CPU we need to play back music in some cases without stuttering. Any ideas on whether this is getting fixed, and how I might work around it?

View 7 Replies View Related

Android :: StartForeground() - No Notification Required

Oct 9, 2010

Hi, I have a "Remote Service", which I am starting at Bootup of the emulator. I want my service to keep running as a foreground service. For this, I am calling startForeground() from my service's onStartCommand(). I don't want any notifcation from the service. But startForeground() needs a notification object as its second parameter. How can I set my service as a foreground service without using any notification.

View 2 Replies View Related

Android :: Using New StartForeground Vs Old SetForground For Services

Nov 26, 2009

I have a couple of services in my application which need to be marked as foreground to prevent them from being killed unnecessarily. Currently I am building my application with the 2.0 SDK but I have android:minSdkVersion="3" android:targetSdkVersion="5" in my manifest file so that I can support 1.5, 1.6 or 2.0 devices. I am currently using only the 1.5 APIs so that my application will run correctly on the 1.5 devices.

2.0 introduced a nicer startForground method that combines setting the foreground flag and starting a notification which can be used to control the service. The 2.0 documentation says that startForground replaces setForeground, and that due to the fact that many applications were mistakenly using setForeground without a notification that could be used to control and close down the service, that the older setForeground method had been changed so it no longer does anything on 2.0. I tried using the newer 2.0 interface but it caused an exception for phones running 1.5 or 1.6. So I am still using the older setForeground interface and calling notify separately. But it appears that since I am building with the 2.0 SDK the older interface isn't really preventing my services from being killed.

View 4 Replies View Related

Android :: StartForeground Backwards Compatibility

Nov 15, 2009

I've got a question as I don't have an Android 2.0 device to test on and this particular aspect seems untestable in the emulator. I've got a service that needs to be run as a foreground service. I have a notification that stops it etc, so I have no problem using startForeground instead of setForeground. However, I'd like to have 1 version of my app that works across all platforms... Is this possible? If my app is compiled with Android 1.5 and uses setForeground, then will that command actually work on an Android 2.0 device, or does it not matter which sdk was used to compile? I've tried compiling with 2.0, and surrounding the call to startForeground with a try/catch, but that throws a VerifyError when the service is started, when run on a 1.5/6 device since startForeground doesn't exist there. Can I catch and ignore the VerifyError somehow and make it work that way?

View 5 Replies View Related

Android :: Implement StartForeground Method In Andorid

Sep 10, 2010

I want to implement startForeground method in Service class for prevent service self kill. Can anybody sent me code for implementing this method?

View 1 Replies View Related

Android :: Killing Apps All Time?

May 26, 2010

I'm a new Droid Eris user and I am constantly having to kill my apps in order to free up memory to keep my lag time and speed adequate. Will I continue to have to do this throughout the life of my phone? Why if I kill the Apps with Advanced Task Killer do the apps keep activating?

View 1 Replies View Related

Android :: Finish Not Killing Activity

Apr 12, 2009

I've got an application that has (among other things) three Activities, let's call them A, B, and C. A is the main navigation point for the entire application, and launches B and C directly using startActivity(). They work fine that way. However, when I call C from inside B, I get a strange problem. The code for launching Activity C is exactly the same in both places. The problem is the hardware back button. In the emulator, it takes two presses of the back button in order to close Activity C and come back to B. On a G1, it takes 3 or 4 presses. Upon seeing this, I implemented the usual suspects in C - onPause(), onStop(), and onDestroy(), and onResume() in B. When I press the back button from C and it doesn't work, I get onPause(), onStop(), onDestroy () - in that order, but nothing happens. When it works (on press 3 or 4 on the G1), I get onPause(), then onResume() in B, then onStop() and onDestroy().

I've tried catching the key press of the back button and calling finish (), but that doesn't make a difference. Has anyone seen this? To pre-empt some questions: All C does is display some data. There are no threads or any other special resources that C might have an active handle to that's preventing it from closing. But out of curiosity, if it did, how would I detect that? Any ideas for further diagnostics here?

View 12 Replies View Related

Android :: Application Killing - Expending Power

Nov 11, 2009

It seems to me that all of these much-touted app killing programs are pretty much worthless. I kill all sorts of stuff I never even opened, and 5 minutes later, it's back again. I'm probably expending more power killing programs than I would if I just let the phone sit idle. Am I mistaken? What good are the app killing programs if the programs keep coming back? I'm starting to wonder if the hyped "run multiple applications at once" bit is more of a drawback than anything. Edit: Would there be any harm in removing the Footprints, Twitter, Gmail and Market programs that came with the phone that I don't use yet keep popping up?

View 2 Replies View Related

Android :: Multitasking / Task Killing Apps

Feb 17, 2010

I am considering getting a Motorola Milestone, which should ship with Android 2.something.I have a Nokia, and I really like the multitasking of the Symbian environment. How is it going to be different with Android? Is it a true multitasking os like Symbian or is it not, like the iphone? How do I switch from one application to another? Is there a button which shows all running apps? I read comments that, on some phones, switching from the web browser to another app and then back to the browser causes the page to reload from scratch. Is this still true or was it a limitation of older versions? Is there a task killer? I read very contradicting opinions on this, but I must say I do not understand why I should leave open an app I don't need, and how much an app left open uses system resources (battery life and RAM): I would have thought that its impact on system performance might have been minimal, but still > 0, right? Then why not close it altogether? Or am I missing something here?

View 6 Replies View Related

Android : Killing Google Voice Mail

Sep 19, 2010

Once upon a time, I set up Google Voice as the voicemail agent on my phone. Now I really regret it.Every time a get a voicemail now, I receive two text messages and an email and it's annoying.So I went to call settings and changed the voicemail from Voice back to "Carrier" and I also removed the Voice number and put back the default voicemail number.Nothing has changed! Any ideas?I am running Froyostone on an HTC HD2, which may complicate things.

View 3 Replies View Related

Android :: Can My App Avoid Killing Process By Task Manager

Jul 30, 2010

My Alarm App. didn't operate because Adavanced task manager killed alarm app....

How can alarm avoid to kill process by task manager except including alarm into ignore list??

Or Can I hide alarm app. in killing list of task manager?

View 3 Replies View Related

Android :: Simulate Killing Activity To Conserve Memory?

Mar 1, 2010

Android doc say:"When the system, rather than the user, shuts down an activity to conserve memory, ... "
But how to simulate this situation?I want to debug the onRestoreInstanceState method,but don't know how to.

View 2 Replies View Related

Android :: After Killing Task Droid Not Launching Correct Activity / What Is Happening?

Aug 19, 2009

Our application is defined to launch a SplashScreenActivity from Intent { action=android.intent.action.MAIN categories= {android.intent.category.LAUNCHER} . After the SplashScreenActivity does its work, it launches another intent to launch MainMenuActivity and finish() is called on SplashScreenActivity.

When we run our app for the first time on our phone, the SplashScreenActivity launches OK, and correctly launches the MainMenuActivity.

However, if we kill the app using TaskKiller, LOGCAT indicates that the application has been killed. I can't debug the app, because launching it from eclipse with the debugger makes it work OK, because it reinstalls the app. Perhaps there is a way to launch the app without reinstalling it?

Here is the Log of us killing our app...

When we launch the application again, the LOG messages for SplashScreenActivity are not logged and it looks from LOGCAT that Android is launching the MainMenuActivity instead. Here is the log...

Can someone Romaine, Diane help us understand what is happening? We saw this happening because some variables are initialized in SplashScreenActivity that aren't available with MainMenuActivity and we were getting NPEs.

View 3 Replies View Related

HTC EVO 4G :: Killing Native Apps

Jul 7, 2010

There are some apps like the NASCAR one that I will never need. Is it a problem to kill apps that are pre-installed on the EVO using ATK or one of the file/task manager apps? Any apps I should not kill for stability reasons?

View 1 Replies View Related

HTC Desire :: Browser Killing Bug

Apr 28, 2010

I do: open browser -> menu -> more -> Settings -> Default Zoom -> "Close" -> back button and then browser crushes, next time I try to start it it crashes again. anyone had same problem?

View 2 Replies View Related

HTC Hero :: Taskiller Not Killing

Dec 2, 2009

I downloaded taskiller and dont really know what im doing. The Icon just climbs from 1 to X. How do I kill these tasks and get my CPU usage down?

View 1 Replies View Related

HTC Incredible :: Something Is Killing My Battery

Aug 8, 2010

I've updated handcent and facebook and now my phone dies while I'm sleeping. It was at 50% when I went to bed. I have the sync for facebook set at once a day and never had this happen till after I updated those two apps. I now have to charge my phone 3 times a day! This is getting ridiculous.

View 6 Replies View Related

HTC EVO 4G :: App Killer Not Killing Talk App / Way To Do

Jun 20, 2010

Advanced app killer is not killing talk app. talk isn't even on the list to select it

View 12 Replies View Related

HTC Incredible :: Apps Still Running After Killing

Aug 30, 2010

I just installed Froyo tonight and reinstalled my apps and use Advanced Task Killer free and when I kill my apps it seems as though I always have some running or they will start running without me doing anything. I have News and Weather, Slacker, Voice search, and Skype mobile running and when I click on KILL selected apps It leaves Voice search running. If I click Kill again Slacker, News and weather and voice search are running. Why are these apps running when I'm not actually running them? Any ideas?

View 13 Replies View Related

Motorola CLIQ :: What Is Killing My Battery?

Apr 1, 2010

So I never use wifi or GPS. I keep the screen pretty low and don't use the motoblur stuff. I still can't get trough a day! Does Open Home or Panda Home kill the battery? What about my SlideIt keyboard?

View 5 Replies View Related

Samsung Captivate :: Anyone's Phone Killing Itself?

Jul 18, 2010

I bought mine at around 1 and have used it regularly with no slow down. I installed LauncherPro when I first got it, and it worked perfect. However, a few minutes ago, my phone just went black, aside from my topmost bar. I pressed the power button and nothing, so I took my battery out, and started it up again...and the same thing happened: black after a few seconds. It's happened 6 times in a row now. What do I do?

View 24 Replies View Related

HTC Incredible :: Camera Killing Battery

Jun 2, 2010

Will take the past three days for example. Monday i took ONE picture and all day under menu>settings>about phone>battery>battery use..... it said the camera app used 94% of my battery and that was after a days use.

Tuesday then rolls around and i didn't use my camera and i had charged my phone monday night but whats weird is it still said the camera app used about 87% of my battery and my battery died QUICK that day.

Today is wednesday and so far the only time i used my camera was when i quickly opened the bar code scanner app but i didn't even scan a code i just opened it for maybe 3 seconds and today it says the camera used 47% of my battery.

Is my camera app staying open even though under running services it isn't there and neither is it there when i use task killers such as "Android system Info"

View 27 Replies View Related

General :: Hiding Apps Without Killing Them?

Oct 12, 2012

Is there any way to hide apps from the drawer but WITHOUT killing those apps

-Rooted

-also tried "Go Launcher" but its very easy to unhide it from menu no protection at all

-Tried "Hide it Pro" = Killing the apps

-Tried "ccswe app manager" = same killing the apps

I need Password Protected Manager To "HIDE" the apps icons only while "Keep them Running in background"

View 7 Replies View Related

Android :: Showing Toasts In A Service From Worker Threads With Service Reference

Jun 24, 2009

I have a service running in the background.I have a background thread that gets a reference to the service from the application's main activity. But when the background thread calls a method in the service to display a toast, I get the "Looper not initialized exception".Why,if I have a valid, bound reference to a Service, does this still happen?

View 4 Replies View Related

Android :: Unable To Start Service Intent Service Not Found

Aug 20, 2009

I am getting following message when i try to launch service.Also is there any specific path on file system where we need to place the .apk file which contains my serivce component only.

View 2 Replies View Related

Android :: Service Auto Restarts On Breakpoint When Debugging A Service

Jul 22, 2010

I am trying to run the sample soft keyboard included in the SDK. I am using the debugger, and the literature says that to use a breakpoint while debugging a SERVICE, I need to include:

android.os.Debug.waitForDebugger();

So here is the portion of the code I modified:

CODE:...........

I have put a couple of breakpoints, at the statements indicated by the comments.

This is what happens: the debugger first stops at the breakpoint1, for a few seconds. But then the service restarts. For the life of me I can't figure out what makes the service to restart.

View 3 Replies View Related

Motorola Droid X :: LauncherPro Keeps Killing Widgets

Sep 21, 2010

All of those with Launcher Pro Plus, check out the update. I bought the Pure Messenger widget strictly to have an integrated Facebook/Twitter feed. I am strictly an idle browser of both feeds - that is, I don't take them very seriously and just scroll through them occasionally. Consequently, I have no need for advanced tools, just an updating feed that I can peruse once in a while. Now LPP has a "friends" widget that is not only a free update to the app, but is faster and smoother than the Pure Messenger widget.

Also, LPP now has customizable rows/columns so you can set as many rows/columns as you want on the homescreens. This is super convenient because I always thought there should have been 5 columns on the homescreens.

View 13 Replies View Related







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