Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Game/ app can't close on device — Gideros Forum

Game/ app can't close on device

VallentainVallentain Member
edited August 2012 in General questions
Hi, I just downloaded gideros today and I made a test game.


I installed the game.apk into my phone, but when I ran the game I couldn't close it. I can close the giderosandroidplayer just fine with the "back" button, but I couldn't close my installed game, which is quite annoying.

The only way to close it was to return to main menu, and I noticed that it automatically closed the game. In other games I played the main menu button won't close the game, just pause it and you can resume the game without restarting from the splash screen.

Also, when running the game on eclipse on emulator I got errors: "called unimplemented opengl es api" (it's flooding the logcat window)


Please help! thanks in advance :)

Comments

  • talistalis Guru
    Accepted Answer
    In android you can control the behavior of the back button just look to the tutorials which are coming with Gideros studio.
    Hardware>>Keyboard
    And for the resuming and pausing the application check:
    Hardware>>Application Life cycle demo

  • Thanks for the help!


    So I just checked the demo, particularly on Hardware>Keyboard...


    So to terminate the application, addkeylistener to back button, and then call application:exit() ?

    From the other thread I read hard exit isn't good? http://www.giderosmobile.com/forum/discussion/281/how-to-terminate-an-application-
  • .......... I searched in google how to properly terminate an application, and it seems like application can't just 'quit' because android automatically kills an application when it needs more memory.

    Okay, so if you can't programatically kill an application, how do you.. at least stop it? So you can do something else with your phone. Like in other applications, the back button will automatically stop any activity, which didn't work at all for my game.


    Also, I tried the demo Hardware > Keyboard and ApplicationLifeCycle on emulator and both won't install/load. The demo files don't work?
  • I installed the demo.apk on my phone and they worked well, except that once again, tapping back button results to nothing. Nothing happened. The app didn't get pushed to the background so I'm stuck with that app until I tap the home button. (Which force close the app = bad design?)
    There is no way to terminate the application.
    - For Android, back button terminates the application but currently you cannot control it.
    .......... So any android app made in gideros won't be able to be stopped with the back button? (not terminate, just stop, so that it can be resumed later?)
  • Alrighty, I found a solution.


    When the back button is pressed, dispatch an event: Event.APPLICATION_SUSPEND

    App closed, I'm happy.


    Is this a good solution?
  • It seems perfectly legit @Vallentain.
  • Hmm hard to tell. My apps usually simply exit app when pressing back button. This is unless you are overriding back key event, which you probably do and this is why it happens.

    Never thought dispatching events could work that way, nice :)
  • yubaroyubaro Member
    edited September 2012
    Hi all, I'm new and I think Gideros an excellent tool to work, I studied with * C to develop but caused me a lot of headaches ... @Vallentain, Could you show some of your code to see how you found the solution?Please with event: Event.APPLICATION_SUSPEND ... Thanks in advance for your answers
Sign In or Register to comment.