Jump to content

Keep Task Alive


Recommended Posts

Guest Chadski
Posted

Hi,

I am just using phone and handsetsms most of the time. When I press Home key from the application, it shows the home screen and when I choose the app again, it display the app immediately.

I know that Android manages the memory automatically and kill apps when needed. Hence, at some point of time, when I choos the app again, the app needs to reload. My question: Is there any way any app stay at the memory such that it will load immediately? Or any way to let android know that this app should not be killed at any case?

Thanks.

Guest phhusson
Posted (edited)
Hi,

I am just using phone and handsetsms most of the time. When I press Home key from the application, it shows the home screen and when I choose the app again, it display the app immediately.

I know that Android manages the memory automatically and kill apps when needed. Hence, at some point of time, when I choos the app again, the app needs to reload. My question: Is there any way any app stay at the memory such that it will load immediately? Or any way to let android know that this app should not be killed at any case?

Thanks.

All that I'll describe can be scripted, and perhaps has already been, but I don't know it, so here is the way "by hand":

Firt, get the pid of the application, do ps |grep <name of application> but the name is the ""java"" name, like com.google.android.gallery3d or com.spotify.mobile.android.ui. Most of the times these names are quite explicit so finding an app in the ps list should be easy.

The PID of the application is the second column.

Now do, as root, echo 0 > /proc/<PID>/oom_adj

And the app shouldn't be killed again for low memory :-)

Or, for something a bit more automated, but it can't be added in an init script, because it needs the app to be started.

echo 0 > /proc/$(ps|grep com.android.phone |awk -F ' ' '{print $2}')/oom_adj

I've a background program that can do that automatically, if someone makes a gui for it, I might add it in my ROMs.

Edited by phhusson
Guest Chadski
Posted

mhm.. thanks phhusson..

your advise above worked.. i just wished that the back button did not close the application.. better than nothin actually.. saves me some waiting time for sms.. thanks so mucn..

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.