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 / Crash when switching apps Andoird

Author
Message
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 6th Nov 2013 15:54
I've had a few notices from testers of my App that it crashes if they switch to another app and then switch back.

Sometimes it also just restarts the app.

As it was done in Tier 1 using the latest Beta I'm at a loss at what to even check for this.

Has anyone experienced anything similar in the past?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Nov 2013 16:03
Are you using the GetResumed() command to detect that the app has been brought back from the background?

This is useful to make sure that it is in a good state when it tries to start back up from where it left off.

There is no guarantee that all the states and whatever in your app will be remembered if it is sent to the background and then resumed.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 6th Nov 2013 16:16
Thanks, I'd missed that one.

I'll add it to the update.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 6th Nov 2013 16:17
Did you use Google Play for your app?
if yes at this developer console website you should see why the app crashed.

for .apk i use the online apk tool, no problem with my apps in store.
https://developer.thegamecreators.com/android/create_apk.php

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 6th Nov 2013 18:38
How exactly do you use GetResumed() ?

If I have two states in my main loop, 1 being normal update and the other being pause, each checking GetResumed and alternating the state when GetResume() = 1. Is this correct?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Nov 2013 19:24
I check it when my app is in actual game play mode. If it is in some sort of message or menu display, the app handles itself well enough because there aren't any physics things going on.


I call my handleReturnFromBackground() if GetResumed() returns 1 when checked in my main processing loop.

What I do in my 'handleReturnFromBackground()' function is to reset the allowed orientation, set the desired orientation (this is a command that is available in Tier 2 only), reset my Physics Gravity and sync rate. Then, if actually playing, it puts the game in paused mode.

Pretty much any of the steps you do to set up the display and environment (aside from loading files and creating sprites) probably should be done when you detect a return from the background. Just to make sure that everything is set the way you expect it to be.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 6th Nov 2013 19:46 Edited at: 6th Nov 2013 19:47
If you already have a pause routine, all you will need to do is include 'GetResumed() = 1' as a way of initiating it... Basically, you'd end up with 2 instances which would run the pause routine, either the user taps the pause button, or GetResumed() = 1...

Thats how I've done it at least...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Nov 2013 19:50
In my handleReturnFromBackground() function, I do call the same pause function as when the user presses the pause button. Naturally that is the simplest way to do it. But I discovered that it is a very good idea to make sure that your display environment is set back the way you want. It is not guaranteed that Android will set everything back exactly as it was. Some stuff is apparently not stored in whatever global area that gets reinstated.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 12th Nov 2013 15:16
There's also some instability issues with AppGameKit beta 19 as far as I can see. AL has helped somewhat with a fix to the app glue file (more info here)
This has helped stability a bit.
However, there still remains random issues on first run after install where the app hangs at a black screen and seems to be running as it does not report as a non-responsive app. Black screen also appears if the app is left running in the foreground and you turn the screen off and back on. I no longer have random crashes when switching apps or going to the home screen after AL's fix to the app glue, but if you have an END call in your app it will often restart itself or close and report that it stopped responding...
I think it is all related to openGL and NDK interaction with AppGameKit interpreter. I look on Google for NDK and openGL issues and there are a few.
Maybe we'll get lucky and a new NDK will come out soon which has better stability for us.
In the meantime I will be trying older NDK versions until it works the way I want it. If that doesn't work then I know the last stable AppGameKit for me was 10811. I'll have to review the changelog to see if it is OK for me to roll back that far.

Login to post a reply

Server time is: 2024-11-24 21:53:50
Your offset time is: 2024-11-24 21:53:50