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 / Mobile Apps - Don't close your app

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Oct 2014 10:57
Naphier wrote the following information in another thread, but I thought it was important enough to get it's own thread.

The desired behavior according to Google for Android apps is to not force close them or terminate the process. The OS expects to make that decision. 90% of apps do not actually close when you exit with a back key. Those that do have a lot of cleanup they need to do to ensure it is done properly. NDK apps often throw an error when the app sends a force close signal.

The OS itself, like iOS, makes the determination of whether the device needs to free up RAM or not and close the app. The reason for this is to decrease loading times. No user wants to wait for an app to reload every time they exit it. Users are accustomed to using the back key to exit apps on many android devices as it is default android behavior. This almost always sends the app to the background. It is evident by the load time when you re-enter the app.

Lots of AppGameKit developers allow the app to actually terminate when the user backs out. This isn't good practice and you're forcing users to fully reload the app if they leave via back button then re-enter.

iOS actually forbids you to have an exit function for the app, though I have gotten away with it. This is not how mobile OSes are designed.

With Task Switchers you can force close apps. Android 4.x has this by default and some manufacturers decide to remove it altogether because you don't need to do it. Most apps when in the background take up no processor power and are in a suspended state. You do not need to terminate the apps! It actually doesn't do anything for you as Android automatically allocates the needed memory for an app as it chugs along and terminates apps that aren't being used. Some apps do stay running, but not many, I've found that Amazon apps do this and even if you do force kill them they just reload in a second or two.

Here's a good thread on this:
http://stackoverflow.com/questions/2439978/why-dont-android-applications-provide-an-exit-option

Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 2nd Oct 2014 12:02
I agree in most part, but I honestly think this is more of a developers/users personal preference than anything else. Sure, Google would rather allow the OS to perform the necessary closing of applications, but I see no harm in giving the user the option (Back Key for 'Exit', Home Key for 'Send to Background) - best of both worlds.

I have to say I disagree with this statement though;

Quote: "90% of apps do not actually close when you exit with a back key"


On Android, the majority of apps I have played (Stick Soccer being the main one at the moment ), pressing the back key fully exits the application (as in, the next time I play it, the app loads from the beginning). This for me, is exactly how I like it... If an app doesn't allow me to exit, all I do is simply force close it, so a Back/Exit key is most definitely my preference...

Just my two pence...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Oct 2014 13:28
if a app have a logik bug you need to restart.
at android i can drag out of open apps list and then i can start it again.
the way with back key that a app ask me for exit is also ok,
it is still in the uses apps list at android and i can quick start again.

the way iOS forbids this and that because rules is not good at all.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 2nd Oct 2014 16:34
I think there is a big difference between what is "best practice" and what big G wants us to think is "best practice".

Quote: "The reason for this is to decrease loading times. No user wants to wait for an app to reload every time they exit it."

We're not talking about floppy disks here, it's loading from solid state memory.

Quote: "I've found that Amazon apps do this and even if you do force kill them they just reload in a second or two."

And that doesn't strike you as suspicious?

So we are told that an app stays in memory to reduce loading times, and then when we force close the app, it is reloaded - presumably to save time loading it later when we actually want it. Madness.

I have a widget on my phone, which is present on every screen (even in games) which allows me to kill background tasks at any time.

I'll be playing a game and suddenly the game starts to slow down or skip. I pop the widget, get the message "15 apps killed 45MB Freed" and my game speeds up again.

If I'm playing a game, I don't want all my other apps sitting in the background on the off-chance that I decide to use them.

Some of those apps in the background are tracking what you do and how much you do it.

Google is all about the data. Who you like, what you eat, when you sleep, it's all money to them.
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Oct 2014 17:19
Ultimately it is up to you, but the current road that Google is on I wouldn't be surprised if down the road they start rejecting apps that have an exit button. I think the main reason for this is that it is unexpected by the OS and can toss an error. This might lead to other issues we don't really know about because we don't know the full architecture of Android OS.
With AppGameKit and Android 4.x you will randomly get "app has unexpectedly stopped" style message when the app terminates itself. I'm not sure if this is due to failure to release or cleanup or just a quirk of NDK. More likely the latter.
So ultimately if you want crash reports, users who get to randomly see this message when closing your app, and force users to reload your app when they think they are simply sending it to the background, then go ahead.
I just wanted to make sure you are all aware that it is not desired/recommended app behavior.


@Marl - yes I do find the amazon apps as suspicious. I hate that they reboot themselves and I don't use Amazon MP3 anymore and only temporarily install Amazon App Store when I want to get an app. Also realize that the majority of users are not keen to this and don't really care.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Oct 2014 17:25
Quote: "I just wanted to make sure you are all aware that it is not desired/recommended app behavior. "


And thats's why I reposted it

Once you understand the rules, you can decide if and how you want to break them. If you don't know the rules in the first place, you may have a bumpy road ahead.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Oct 2014 17:43
Most apps, including Google's own apps Gmail and YouTube, close down when you back out of them. Only my Samsung web browser doesn't close down. So this is not something I think you should consider. It's different with iOS.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Oct 2014 17:52
I'm on KitKat, just tested YouTube and Gmail, they both stayed resident in memory when I exited. Same for Play Store, G+ and Play Music.

On the flip side, King games (Candy Crush, Pyramid etc) always close. I have to say I find it a little irritating that they take so long to load, I would prefer them to stay resident until Android needed the memory and tidied them up.

I've never had slow downs that require me to close programs down. I always have Audible and Tasker sat in the system bar along with a long list of many apps I open and close throughout the day.

Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Oct 2014 18:22
Did you check the task manager or just the recent apps list?

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd Oct 2014 18:32
I have an optimiser app that shows me what is in memory. I could also see when returning to the app that it was much faster the second time (I cleared my app cache before trying the first time)

The optimiser app claims to save battery by closing apps that are still resident in memory. If they are paused, I don't see how this can be true? I can leave my phone on at night after opening lots of apps all day, and it only uses 1-2% of battery overnight.

Login to post a reply

Server time is: 2024-11-25 10:33:05
Your offset time is: 2024-11-25 10:33:05