Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Some Apps written in AGK may suffer from the 'BACK BUTTON' Glitch.

Author
Message
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 24th Sep 2014 23:23 Edited at: 24th Sep 2014 23:36
I came across this when I had someone test my game on the upcoming new operating system for Android- tentatively called Android L.

I've noticed that when he got to the home screen of my game, instead of pressing the exit button I had on the screen, he used the back button on the device. After about the 3rd or 4th time the game exited with the message
Quote: "Unfortunately, Prove Your Worthiness has stopped"
.

So I went to try this out on my Galaxy S3 and sure enough it did the same thing after pressing the back button about 9 or 10 times.

I then wondered if this was something that was common to AppGameKit, so I tested games made with AGK. And out of all that I have tested most of them did the same thing. And it doesn't matter if apps are written in Tier 1 or Tier 2.

Games made with AppGameKit that suffered from this are:
Rush to Adventure - at 10 times any where
Neon Bunniez - at 10 times any where
Puzzword - at 10 times any where
Birney's Run - at 10 times any where
Holey Cow - at 11 times at home screen
Pirate Poker - at 10 times during gameplay
Kayakescape - at 10 times during gameplay

..and this is not an exhaustive list.


Games made with AppGameKit that did not suffer from this are:
Sudoku in Space
Mr. Dork 2
Horse Meat Inspector
Wordspinage
Shape Time
Santa Xmas Rush
Leg it!
Comet Bird
Shuriken Strike: Ninja Master

..these games may suffer from it but doesn't probably due to programming to have the program exit if the back button is pressed.


Now this led me to try out some other companies games to see what happens.
These games didn't close out at all. Their exit screen would come up when I pressed the back button, and then the exit screen would close out when I pressed the back button again.
Candy Crush
Jetpack Joyride
Angry birds
Pengiun Run, etc, etc
Blob Blast

Blob Blast did crash at first but I have not been able to repeat it.

Guys, you need to take note of this and handle it appropriately.

Shape Time passed with flying colors because I thought it would crash during game play but it pulls up a pause screen and no matter how many times I pressed the back button, it didn't crash or lock up.


Now, you may think that people won't press the back button 9 or 10 times to exit your game, but it happen during a test for me. That's why I'm sharing it.

Prove Your Worthiness
KG2Entertainment.com
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2014 00:32
i belive the back button is keypressed with keycode 27 (same escape key)
and u handle it by yourself, or not?

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 25th Sep 2014 00:46
Quote: "i belive the back button is keypressed with keycode 27 (same escape key) and u handle it by yourself, or not?"


Yes, I understand that. But if I don't handled it, it shouldn't force close the app.

In, rush to adventure, there is attempt to handle that key press by bringing up a menu, and then when you press the back button again it closes out the exit menu. Then you hit it a third time and it brings up the menu and then a fourth time is close the menu.

But about 3 or 4 rounds of that the exit menu makes it up about half way and then the app force closes.

Prove Your Worthiness
KG2Entertainment.com
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2014 01:16
ahh, understand, i will try with my apps tomorrow.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Sep 2014 01:30
This is to do with a fix for the back button crashing the app when the keyboard is visible (the native_app_glue fix), it seems the fix makes it crash when rapidly pressing the back button instead. I've added a new work around for this to the next version so both cases should be handled successfully.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Sep 2014 09:56
@Paul,
i can agree it happens in v2 alpha 6 too if pressing
back often one after another. thanks for a fix.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
yamyam
11
Years of Service
User Offline
Joined: 12th Jan 2013
Location: Black Country
Posted: 25th Sep 2014 15:57
Just tried this on my Puzzword and it does indeed stop responding if i press the back button ten times, nice spot JoJo hard to find that one.


ThrOtherJoJo
12
Years of Service
User Offline
Joined: 24th Mar 2012
Location: California
Posted: 26th Sep 2014 13:49
Thxs for the quick fix!!

Prove Your Worthiness
KG2Entertainment.com
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Sep 2014 22:46
This is because you guys are using the END command in AppGameKit which terminates the app. Android sees this as an unexpected termination since the OS itself wants to determine when to close the app. As you may notice apps tend to stay in memory on Android. This is the desired behavior. If the app itself is terminating then it throws up OS error flags.
All of my games implement the suggested method of sending the app to the background. This is done very easily and should be the default behavior in your apps.

To do this just a simple modification to the AGKHelper.java file:


Then in your AppGameKit code call ShowMessage("-1") only once when the back button is pressed to send the app to the background. Do NOT call end and keep the app loop going.
This started happening with KitKat and only periodically raises the flag, but you also have to remember that users will often back button to send an app to the background and if they launch the app again and have to wait for it to load then this is undesirable and unnecessary behavior.

Login to post a reply

Server time is: 2024-11-25 10:52:16
Your offset time is: 2024-11-25 10:52:16