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 / How to exit a T2 app

Author
Message
lumni
9
Years of Service
User Offline
Joined: 28th Mar 2015
Location:
Posted: 14th Apr 2015 01:56
all threads about this are really old and the suggestions dont work anymore. id like a portable way to terminate the app when the user touches or clicks a text or spirte. thanks.
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 14th Apr 2015 07:33
Well if is c++ you can use exit(0) but i don't suggest to do it.
Apple for example reject the use of internal closing the app, cause it must be closed using the home button.
I think for Android is the same.

george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 14th Apr 2015 10:07 Edited at: 14th Apr 2015 10:07
"Last thing I remember, I was
Running for the door.
I had to find the passage back
To the place I was before.
"Relax," said the night man,
"We are programmed11 to receive.
You can check out 12 any time you like,
But you can never leave."

Bill Gates...
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 14th Apr 2015 10:11
GEKKO is correct. On Windows either call destructors in a response to to a POSTQUIT message or drop out of the main loop through the destructors.

<<It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.>> Dijkstra
lumni
9
Years of Service
User Offline
Joined: 28th Mar 2015
Location:
Posted: 14th Apr 2015 10:21
on andoid its almost always possible to exit through the back button and thats what im trying to do. even if it wont exit, just send the app to the background, i want to do that through the back button, not only the home button.

i need to know what to call in

if (agk::GetRawKeyPressed(27)){
//here
}

thanks for the answers.
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 14th Apr 2015 21:43
As xGEKKOx says, for Tier 2 you can use:


Google/Android and Blackberry accept it in their stores, Apple doesn't.


lumni
9
Years of Service
User Offline
Joined: 28th Mar 2015
Location:
Posted: 14th Apr 2015 23:46
thanks, thats what I was looking for.
may I ask you how did you even know MasterReset() existed since its not in the documentation ? does it call App.End() ?
Kendor
21
Years of Service
User Offline
Joined: 31st Jan 2003
Location: Malta
Posted: 15th Apr 2015 22:20
The interpreter code (T1 - Core.cpp) for android uses it as part of the cleanup process:



As you can see, App.End() needs to be called separately.


Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Apr 2015 04:45
This is the code that I have been using:


I last tested in in Windows, Mac and iOS using AppGameKit V2 11, I think.

The code is set to detect the AppGameKit type.

I use the same 50+ pairs of .cpp/.h files for all platforms.

Cheers,
Ancient Lady
lumni
9
Years of Service
User Offline
Joined: 28th Mar 2015
Location:
Posted: 30th Apr 2015 03:03
thank you

Login to post a reply

Server time is: 2024-11-25 21:26:00
Your offset time is: 2024-11-25 21:26:00