[Q] Force an App to Keep running in Background? - General Questions and Answers

There is a stream specific audio app I use that quits if I switch to the home screen or another app, instead of keeping the audio going. The display has nothing useful other than a pause/play button. This means I can't check my email without starting the app all over again.
I know that the app can be designed differently to avoid this, but thats not happening. Is there any way to trick the app into thinking its still being displayed?
By the way thiis is the behavior on my Nexus 4 phone. On my Nexus 7 tablet it keeps playing in the background. Both run 4.4.2.

Related

gps bug?

Dont know if anyone else has noticed this but has happened to me a couple of times now. If I start up an app that uses gps i.e speed test then when I quit out of the app the gps symbol remains in the notification bar flashing. I dont know how to get rid of it and have to reboot my phone. Any ideas guys?
Is it possible that your app is still running in the background even after you quit? Some apps do that.May explain why gps is still running.
Sent from my Nexus S using XDA App
Hi. Yeah thats a possibility and have been thinking it through. Take for instance speed test, it has no exit key so you have to quit out of it by either clicking back or home. Maybe that is where the bug lies and its nothing to do with my nexus.
One other question I have if you could help me out is about multitasking. Say if I hit the home button when an app is running it still runs in the background. How long does it do this for with out resorting to using an task killer or similar?
Cheers
rob77 said:
Dont know if anyone else has noticed this but has happened to me a couple of times now. If I start up an app that uses gps i.e speed test then when I quit out of the app the gps symbol remains in the notification bar flashing. I dont know how to get rid of it and have to reboot my phone. Any ideas guys?
Click to expand...
Click to collapse
This problem is not unique to the Nexus S. I actually haven't seen it on the NS (yet), but I see it routinely on my SGS i9000.
You should be able to easily get rid of it by just turning on and off the GPS with the Power Control Widget. No need to reboot. Turning on and off Location Services in Settings screens for the phone should also do it for you.
Thanks ill try turning it off using the location settings next time it happens. I did try with the widget but when i turned it back on it returned and was still there.
rob77 said:
Hi. Yeah thats a possibility and have been thinking it through. Take for instance speed test, it has no exit key so you have to quit out of it by either clicking back or home. Maybe that is where the bug lies and its nothing to do with my nexus.
One other question I have if you could help me out is about multitasking. Say if I hit the home button when an app is running it still runs in the background. How long does it do this for with out resorting to using an task killer or similar?
Cheers
Click to expand...
Click to collapse
From my VERY limited experience, some apps stop running as soon as you press home screen (e.g. website/forum apps), some you need to specifically exit the app (if there is an exit option), and then there are others that stay running until you force stop it. Seems like it depends on the design (or mis-design) of the app.
You can view what apps are still currently running under Manage Apps. You can also manually stop those processes there if need be.
Hope this helps.
Thanks. I've tried looking under manage apps/running apps before but the task I think the gps bug is coming from is never listed in there. Infact not a great deal gets listed in the standard gingerbread applications settings. Games that I know are still running in the background dont get listed either for some reason.

Xoom Music Player Crashes when running background?

After the 3.1 update, when I listen to music while the Music app is running in the background (using the widget or notification widget), the songs always crash in like 30 seconds.
Anyone getting this? Its pretty frustrating and annoying since it never did this before.
Should also write, that when I am listening to music with the player open, all songs work fine.
Anyone? No one is getting this problem?
Sent from my Nexus S using XDA App
Is it force closing or just stopping?
If it is just stopping, I would guess that honeycomb is removing it from ram due to being low on ram. It really shouldn't do that since it is an activite service, but that is my guess.
Sent from my Xoom using XDA App
Hmmm yea it doesn't force close it just stopped and the icon disappears like the xoom closed it out. However that really sucks because it is running....you know it may be a bigger issue. When I watch playon and switch to a browser for a sec then switch back I have to reload it and log in again. Its annoying but I never had to do that pre 3.1. Anyone else having these issues? Did Google mess with background apps and the multitasking resource allocation? Still the music player is active sso I don't know what is going on. Any help would be greatly appreciated
Sent from my Nexus S using XDA App
No issues here. Sorry to hear... try a reset?

Aggressive background process reaping

I'm considering rooting, even though I'd prefer to keep this device stock, simply to have the ability to tweak the background process killer in Honeycomb. I don't know if it's something Asus cranked up, but I haven't heard of anyone else with a tablet having the same problems that I do. I literally cannot listen to music (through ANY app, default Android Music or whatever, they ALL die) because at some random point, beteeen 5 and 15 minutes after I switch away from the player to do something else with my tablet, ActivityManager will kill it and respawn it. This obviously stops playback, which is annoying.
I have no task killer apps or anything like that running on the tablet. Checking logcat shows nothing leading up to the event, simply a line for ActivityManager whacking the music player PID, then restarting it. If I leave the player in the foreground, it's fine, and plays without stoppage. When I switch away from it to browse, or write this post in the XDA app (expecting music to die shortly ...) or anything, it will get killed, even though it's still playing music.
Anyone else experiencing something like this?
Sent from my Transformer TF101 using xda premium
No, it's certainly not normal, and I suggest doing a factory reset before rooting if you want to keep it stock (even though custom ROMs do offer better overall performance). Does it happen randomly, even if you're sitting at the desktop for the 15 minutes, or does it only happen when you are switching between lots of apps, or using memory heavy apps?
Gary13579 said:
Does it happen randomly, even if you're sitting at the desktop for the 15 minutes, or does it only happen when you are switching between lots of apps, or using memory heavy apps?
Click to expand...
Click to collapse
The only situation which will keep the app from dying is if it's the active, foreground app. Strangely enough, the screen can sleep, as long as that music app is the one that's up when it shuts off, and it'll keep playing. I can sit at the home screen, and it will die. It will die if I switch apps, to run Talk, or the browser, or Mail, Market, anything other than Music (or any music app, I've tried them all, it's not a specific app problem.)
Checking the log via logcat shows an entry from the ActivityManager class killing the PID of the app, then immediately restarting it. If I'm watching it when it happens, the music stops, and if there's a status bar icon for the player (such as Music, WinAmp, or PowerAmp) it disappears for a moment, then reappears, on the same track, but reset to the beginning. I suspect this is because the current track is cached/saved somewhere but the position is not when the PID is killed. Oddly enough, the app must be considered to be in a "crashed" state because of the instant restart a second later.
As I said, the tablet is 100% stock. When I got it (early August, I think?) there was a single update that immediately applied. Then I got the latest 8.6.5.9 US update what, a few weeks ago? That's all that's been done as far as the code that's running on it. No root, ever, no custom ROMs, nothing.
I suppose I should do a factory reset and see if that helps. I just hate having to set everything up again without a backup (which I obviously don't have, not rooted.)
[Edit: I should add that the music player isn't the only app that ActivityManager logs kills/restarts on. logcat is full of them.]
Factory reset last night (VolDown while powering on, select "reset," so this was a full wipe) and it's STILL DOING IT.
Sent from my Transformer TF101 using xda premium
hm strange, maybe there is an issue with your music library that crashes the music player? file corruption during transfer, maybe?
or some app your recently installed is not 100% Honeycomb compatible and makes the Activity Manager go nuts.
d3l1 said:
hm strange, maybe there is an issue with your music library that crashes the music player? file corruption during transfer, maybe?
Click to expand...
Click to collapse
I've wiped and re-copied the music files several times. Also, as I said, if I keep the music app active (foreground) it plays forever, no problem.
or some app your recently installed is not 100% Honeycomb compatible and makes the Activity Manager go nuts.
Click to expand...
Click to collapse
I wiped back to stock with no apps and it still does it.
No, I actually did some more research yesterday, involving BTEP and staring at the output of "top" for an hour or two.
Warning: Linux babble ahead --
It seems that ALL the background apps will respawn at the same time. So, when Music drops and restarts, the com.google.android.music process is not the only one dying, pretty much anything running forked from zygote, except for the following exceptions: system_manager, com.android.systemui, com.nuance.xt9.input (part of the Asus keyboard,) com.android.phone (with wifi only, why is this running?) and com.google.process.apps.
You can tell when all the application PIDs are grouped tightly together, in the range of a few hundred, that some event is forcing a mass kill and refresh of the apps, except, curiously, if the app is running in the foreground. So there's at least some logic involved in whatever's doing it, and not simply a kill -HUP `pidof zygote` or something like that. (I don't even know what that would do, heh.)
While monitoring top I didn't notice any processes with extreme CPU or RAM usage. Everything looked fairly well behaved. The system had plenty of memory available at all times. I checked dmesg for any kernel errors, nothing at all to indicate a failed read/write or any other type of hardware error.
Since what I'm looking at is basically a Linux system (and I troubleshoot this sort of stuff for a living) I'm trying to dig into it from that angle first. If I can find out WHAT is causing the mass process kill, then I can hopefully have a better idea of WHY.
Sometimes I hate computers.

Galaxy S6 process killer exclusion list?

Is there an exclusion list somewhere to keep the system from killing certain apps?
Examples:
Google Music - If I haven't played anything in an amount of time, it kills the process. I can't hit play on my Gear S2 and start it up again, and when I get in my car, the radio shows the track, but won't play anything. I have to get my phone out and hit play on the screen. I know it's being killed because a) both the Gear S2 and my car worked fine on my Nexus 6 and b) the Music persistent notification is going away, comes back when I manually touch play. If that notification is running, I can control the playback with the car or the Gear S2.
Network Monitor Mini Pro - this should stay running in the background. I've been using it for a long time, on a bunch of different devices, and never had any trouble with it. But this S6 keeps killing it. If I run the app settings, it shows up. I can go home and it stays for a while, then eventually it gets killed off by something.
I tried turning that Battery Optimization thing off, but it doesn't seem to be causing this. I haven't been able to find any settings for this. I've been using Nexuses only for a while, maybe I'm just not looking in the right place.
Does anyone have any ideas?

[Resolved] How to prevent android 4 from auto-closing background apps ?

Hello, for example, when I switch from a game to the browser for a few minutes, when I come back to the game it restarts completely, right now the only solution I found to this is to switch back to it regularly to keep it open, which is annoying and ridiculous. I tried dev option to allow 4 background apps, it didn't work, I did read about battery optimization but my phone is only on android 4.1.2 with no way to upgrade it so I don't have this option.
So, is there some app or modification I can do to avoid this ? If it's the only solution, it would even be fine if some autohotkey-like script would automatically switch back and forth to it as a hotfix.
turn off battery optimization
Unfortunately it's not present in android 4 unless I'm mistaken.
If anyone have the same issue here is a workaround I found: I stop absolutely everything, adblock, music player, onedrive (which I even force stop so it doesn't reopen itself half an hour later), even a tiny app that just forces the phone to stay in landscape mode, and I never switch off the screen and avoid to press the home key, this way I have exactly one current and one background app that stay open.

Categories

Resources