I would like my game to absolutly quit when i hit the hard button "home" on my android device.
function endgame () {
if (Input.GetButton ("home")) {
Application.Quit();
}
}
this code will stop game and take me to my device home screen but the game is still running in the background of my device in a paused state (good for a phone call or a required pause) but it's still processing.
How can i force a complete quit of the game on android?
As you say HOME is a 'hard' button; actually so hard that it can't be intercepted. Instead the application will be sent to the background with a OnApplicationPause() call. Theoretically you could add a call to Application.Quit() in OnApplicationPause() but thats really not recommended as it will cause the application to quit if you receive a phone call etc.
Applications should be paused when pressing HOME (or pressing the power button, or receiving a phone call); this is part of the Android OS architecture. A paused application doesn't actually consume that much resources (in terms of CPU / memory) as all graphics resources (created textures, meshes etc) are flushed when the application is sent to the background, and the player loop is also not updated when the application is paused.