• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Android Closing app

Z

zendraw

Guest
So with game_end(); if you close the game its not really closed, but still runs the closing loop, so if you try to run the game again it runs the game_end(); code every time, so you have to close the game from the app settings if you want to run it again. how do i close the game so that its actually closed? is there such a way?
 

FoxyOfJungle

Kazan Games
There is no way to completely close Android applications. Instead, they just stay in the background. One solution is to restart the game whenever you call game_end().
 
Z

zendraw

Guest
game_end();
game_restart;
like this? is that how people do it.
 

gkri

Member
So with game_end(); if you close the game its not really closed, but still runs the closing loop, so if you try to run the game again it runs the game_end(); code every time, so you have to close the game from the app settings if you want to run it again. how do i close the game so that its actually closed? is there such a way?
Android engineers are not suggesting to force close the app, but let it eventually killed in background processes by the system. However, I have noticed some issues with game_end like the game crashes silently in background and if the user tries to return to app is not possible until manually terminate it and restart it.

I made an extension that it can send the game natively into background processes with java code, which resolves the issues of game_end(). The extension also offers the option to force stop the game (but better avoid to do that, unless you have a very good reason)...

After importing the extension just call android_game_minimize() for natively send the game into background processes or android_game_end() to terminate it (latter not recommended)

You can find the extension here
 
Top