Friday, January 13, 2017

What happens to a running program when "home" button is pressed in Android phone?


One thing puzzles me. It looks like if I use some program on Android and press the "home" button I see the home screen and can rerun the program and see that program in the same state as it was before - so looks like the program is not fully restarted, just suspended and then resumed.


Yet that doesn't seem to happen consistently with Air Control game. Sometimes when I'm playing Air Control and press "home" and later rerun Air Control - it is paused (as if I pressed "pause" button) and I can resume the game. Sometimes the same leads to Air Control dropping the game and starting anew.


So it looks like I don't understand something.


What's the deal here? What happens to a program when "home" is pressed? Does it continue running or what does it do?




Answer



Pressing the Home switches you from the app to the home screen, whilst leaving your app running in the background. This is a bit like switching between windows on a Windows PC.


Except that when your phone is running low on resources like memory it will start to close apps that are running in the background, so that your phone has enough resources for what you're trying to do now. Games are often amongst the first apps the phone will "kill" to save resources as they often use a lot more memory and CPU than other apps. This is why sometimes your game is still running paused, and sometimes Android has closed it for you.


The Back button is the way to close apps so that they are actually closed.


See also What is the right way to close apps in Android?


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...