02-05-12 08:27 AM
92 1234
tools
  1. Rickroller's Avatar
    But as I said 2 posts up...
    Also, I`m not sure having to suggest rooting a device in order to get this functionality is a positive.
    You speak of rooting as if it's a negative. Having control over your own device is hardly a negative imo. And while I agree with you that there can be apps that will bog down the system, and drain battery..this isn't Androids fault..it's the apps fault. Which is why when I have poorly coded apps such as this, I uninstall them. This was the case with the Facebook app. Found it to be a big battery drain, so I uninstalled it. I use a FB launcher widget for most of my info, and will just go to the full website if I need to do something else.
    01-06-12 10:57 AM
  2. Superfly_FR's Avatar
    @ Innovatology : Short means clear in Peter's vocabulary. Once again he did this right
    Innovatology and peter9477 like this.
    01-06-12 11:01 AM
  3. blackjack93117's Avatar
    So the question becomes "why cant apps spawn and run services in the background". Why is the question:
    "why can't apps run in the background" - because the answer is that they can.

    This is not a case of wrong answer - it is a case of wrong question.
    I'd suggest/request that you request a mod to change your title, because it gives the wrong impression.

    Thanks.
    Last edited by blackjack93117; 01-06-12 at 11:28 AM.
    barskin likes this.
    01-06-12 11:26 AM
  4. Angus_CB's Avatar
    Just to add to Peter's excellent explanation;
    When you close an app and it appears to be running in the background it is not the app itself that is running but a tiny spawned executable. This executable only provides services like notification for example. If you tap the icon for the service the original app is launched again.
    01-06-12 11:34 AM
  5. helsinki98's Avatar
    Peter answered this nicely. Having an android phone before my playbook I do miss having notifications come from programs which appear to be closed on the android, although saying that I just received an email notification on the email service with android player which wasn't open (on playbook). I don't know if the android player works differently to native playbook apps and doesnt actually close and performs like an app on android or not or not but gave a good imitation of it.
    The multitasking on the playbook provided by qnx is great but it feels a bit like using windows and not being able to have programs provide notifications from the taskbar and having to have everything open full screen for them to be running, which gets a little cluttered when I try and navigate through 5-6 different programs when 3/4 of them should be running in the taskbar. It might just be the layout of the os though or how it presents programs and multitasking. I can defiantly see what the op means about apps feeling sand boxed though, even though they arn't.
    01-06-12 11:36 AM
  6. BuzzStarField's Avatar
    Just to add to Peter's excellent explanation;
    When you close an app and it appears to be running in the background it is not the app itself that is running but a tiny spawned executable. This executable only provides services like notification for example. If you tap the icon for the service the original app is launched again.
    When you close an app it stops running. When the app is open (i'e. "running") its behaviour is regulated by the "Application Behavior" setting on the General settings screen.

    When the device is in showcase mode "all open applications are active and never pause in the background." When the device is in default mode, "An application stays active in the backgriound until another application goes fullscreen." When the device is operating in paused mode "all applications are paused in the background and activated when tapped."

    A developer has no control over the mode settings but the app does receive notifications when the device's state changes. For example, my app is designed to update itself automatically every minute. Depending on device settings the updates may or may not occur. If the app gets paused by the system, it receives a notification that processing is about to stop. When the app is activated again, it gets another notification so that I know that the app can be be updated.
    Last edited by BuzzStarField; 01-06-12 at 12:01 PM.
    01-06-12 11:58 AM
  7. kennyliu's Avatar
    When you close an app it stops running. When the app is open (i'e. "running") its behaviour is regulated by the "Application Behavior" setting on the General settings screen.

    When the device is in showcase mode "all open applications are active and never pause in the background." When the device is in default mode, "An application stays active in the backgriound until another application goes fullscreen." When the device is operating in paused mode "all applications are paused in the background and activated when tapped."

    A developer has no control over the mode settings but the app does receive notifications when the device's state changes. For example, my app is designed to update itself automatically every minute. Depending on device settings the updates may or may not occur. If the app gets paused by the system, it receives a notification that processing is about to stop. When the app is activated again, it gets another notification so that I know that the app can be be updated.
    Thanks. But this is not the "real-time" notifications I meant. On the Playbook, you should open/activate an app for the accumulated notifications to go through.

    And sorry for the bad choice of words. I did in fact mean apps that run as background services/processes. For me, the end user, they are just "apps" running in the background.
    01-06-12 12:11 PM
  8. blackjack93117's Avatar
    You don't need to go into task manager to close apps. That's how Android is designed to run..the system itself will manage it's own memory and close things as its needed. And if this really does bother you..you should look into CyanogenMod roms. They have a setting to long press the back button to "kill" the application completely.
    If things are closed as needed - either they are always running and using resources (memory- battery) or they are not truly multitasking - they are in some kind of minimized or switched off mode.

    I prefer handling it myself, with the flick of a finger, rather than whatever cyanogenMod roms might be....
    01-06-12 12:18 PM
  9. blackjack93117's Avatar
    Thanks. But this is not the "real-time" notifications I meant. On the Playbook, you should open/activate an app for the accumulated notifications to go through.

    And sorry for the bad choice of words. I did in fact mean apps that run as background services/processes. For me, the end user, they are just "apps" running in the background.
    But they are not really apps running in the background at all- an app running in the background can still do stuff like stream audio, continue playing a video while listening to the audio without pause or interruption, - monitor things, continue downloading uploading, etc. a lot more than just simple services like monitoring for notifications.

    VERY poor choice of words.
    Last edited by blackjack93117; 01-06-12 at 01:19 PM.
    01-06-12 12:21 PM
  10. app_Developer's Avatar
    So if I opened an IM app first, then opened several other apps it would start by closing the IM app I want to stay open?
    It's not FIFO. iOS and Android both have priority lists that tell them which processes to kill if there is memory pressure. Factors include if there is a UI, how much memory they use, last use, etc.

    These devices don't have swap files. So there is a hard limit to RAM. Both the Android and Apple teams decided independently (and correctly, IMO) to make this transparent to the user so it just works.

    Your job as an Android developer is to make sure the user won't notice if your app process(es) go away. And the app framework has all the facilities to make that pretty easy to do.

    Once the user has 10, 20 apps that she's switching between over the course of her week, you don't want her having to say "hmmmm, I want download a bunch of pictures in my Flickr app now, so what other app now do I need to close first..."
    Last edited by app_Developer; 01-06-12 at 12:25 PM.
    VerryBestr likes this.
    01-06-12 12:23 PM
  11. kennyliu's Avatar
    But they are not really apps running in the background at all- an app running in the background can still do stuff like stream audio, continue playin ga video while listening to the audio without pause or interruption, - monitor things, continue downloading uploading, etc. a lot more than just simple services like monitoring for notifications.

    VERY poor choice of words.
    Point taken, but if you've used other platforms and read my explanation in my OP, it should be quite obvious what I am talking about. Besides, the question was more of a question for developers, who would definitely understand what I mean.

    Anyway, I hope this missing feature, which seems to be standard on all other OSs, is implemented on QNX as well. Hopefully, sooner than later.
    Last edited by kennyliu; 01-06-12 at 12:48 PM.
    01-06-12 12:31 PM
  12. omniusovermind's Avatar
    You speak of rooting as if it's a negative. Having control over your own device is hardly a negative imo.
    Whether or not rooting is good really wasn't the point. The point was that having to suggest modding as a solution for a product shouldn't be viewed as a good thing. A crappy analogy is in order so you get what I mean.

    Let's say I bought a panasonic 3D HDTV but the 3D didn't have an option to be shut off when I'm not using it unless I installed a 3rd party custom ROM. This caused my TV to draw more power and raised my electrical bills. (I'm not saying this happens, we're using an analogy here remember). Let's say Sony's television for the same price had the option to turn 3D on and off thus allowing me to save on my electrical bill, as well as allowing me more control over how I use my TV.

    Yes I know android is designed to manage resources automatically by closing inactive apps when more resources are needed. But the problem I have with that method is that android allows a whole bunch of inactive apps to be using background resources before it starts closing them down. It's reactive rather than proactive. My main point is...

    QNX gives me the ability to have as much or as little system resources free as I want, whenever *I* want, not when QNX wants.

    I do hear you. It can be done on Android by using 3rd party software. I know if I don't like that answer, I'm free to not choose an android tablet. All I'm saying is that I prefer the way QNX handles multitasking and resource management to how Android (or iOS) does it.
    01-06-12 12:38 PM
  13. app_Developer's Avatar
    Having a process is RAM in a paused state does not consume battery. It's not like you can turn the unused RAM off.

    In fact, both Apple and Google found that reloading apps from flash consumes far more energy. This is why both engineering teams choose to maximize the use of RAM. That is the smarter choice.
    kennyliu and VerryBestr like this.
    01-06-12 12:43 PM
  14. app_Developer's Avatar
    When you close an app it stops running. When the app is open (i'e. "running") its behaviour is regulated by the "Application Behavior" setting on the General settings screen.
    Thanks. Do you have any analytics tracking how many of your users use the default mode?
    01-06-12 12:46 PM
  15. BuzzStarField's Avatar
    Thanks. But this is not the "real-time" notifications I meant. On the Playbook, you should open/activate an app for the accumulated notifications to go through.

    And sorry for the bad choice of words. I did in fact mean apps that run as background services/processes. For me, the end user, they are just "apps" running in the background.
    I don't quite follow you. Could you give me one or two examples of third-party apps that can override the device's behavior settings?

    Also would you mind pointing me to documentation that confirms the notion of "tiny executables" that replace the full app when running in the background?

    Much appreciated.
    01-06-12 12:48 PM
  16. Superfly_FR's Avatar
    Thanks. Do you have any analytics tracking how many of your users use the default mode?
    You should make a poll for this. This is an interesting usage stat.
    P.S : I use demo mode always.
    01-06-12 12:53 PM
  17. kennyliu's Avatar
    I don't quite follow you. Could you give me one or two examples of third-party apps that can override the device's behavior settings?

    Also would you mind pointing me to documentation that confirms the notion of "tiny executables" that replace the full app when running in the background?

    Much appreciated.
    I am not sure what you mean by overriding the device's behavior settings. But in Android, you get a third party app's (e.g. IM) notifications "integrated" into the OS itself (just like AppWorld notifications) and the app will be running in the background when the window is actually closed and will usually use very little of the processing power and RAM.

    I think the question about "tiny executables" should be addresses to a different poster. I never mentioned anything about executables.
    01-06-12 12:55 PM
  18. omniusovermind's Avatar
    Once the user has 10, 20 apps that she's switching between over the course of her week, you don't want her having to say "hmmmm, I want download a bunch of pictures in my Flickr app now, so what other app now do I need to close first..."
    I'm not sure if that's a fair comparison. After all, nobody ever bats an eye at the fact that they start and end programs in windows all the time and have for years. After I'm done surfing these forums, I'm going to click the red "X" and close firefox just like I have for years. I could be running firefox, MS Word, an email program, media player all at once for hours at a time on my PC but eventually I'm going to close them... when I choose to.
    The problem with Android "multitasking" is that it doesn't really fully keep an app running. when you hit the home button to start a second or third app, it places the first one into a suspend mode, ready to be recalled quickly if you go back to it, or ends it if it's been inactive long enough. Not a bad way really, but unfortunately some apps don't always suspend in exactly the state you left them in. For example, some blog apps, if I home-button out of them will automatically return to the launch screen of that app rather than the particular blog I was reading within it, simply because android decided "sorry bro, I think you've been off of that app long enough and I don't care if you fully intended to come back to that exact same screen".

    With QNX, If I want an app to stay exactly the way I left it, while I watch a video, browse the web, or whatever, it will, and for as long as I want.
    01-06-12 12:55 PM
  19. BuzzStarField's Avatar
    Thanks. Do you have any analytics tracking how many of your users use the default mode?
    No I don't - there is no reason for me to track usage. I just have to be aware when the app is paused by the system so I can account properly for the period when it was inactive.

    You should note that developers would like some APIs so we could write apps like alarm clocks that need to run in the background to be as useful as they could be. All we can do is inform the user to put the device in showcase mode for best results. Even then the restrictions forced upon us in the current OS make it impossible to build apps that interact with each other or with system services.
    kennyliu likes this.
    01-06-12 12:58 PM
  20. omniusovermind's Avatar
    Having a process is RAM in a paused state does not consume battery. It's not like you can turn the unused RAM off.

    In fact, both Apple and Google found that reloading apps from flash consumes far more energy. This is why both engineering teams choose to maximize the use of RAM. That is the smarter choice.
    maybe you can answer this question for me then because it's been bothering me for a while. When I've run a full day of numerous apps, videos, games etc, I find that leaving the apps via Home Button (which as you said, places the app in a pause state until they've been inactive for a while) rather than back-buttoning out of them all seems to make my phone run slower and less responsive even though those apps are no longer running, and haven't been for a couple of hours. Why is that?
    01-06-12 01:00 PM
  21. BuzzStarField's Avatar
    With QNX, If I want an app to stay exactly the way I left it, while I watch a video, browse the web, or whatever, it will, and for as long as I want.
    Yes provided either the app is provided by RIM and behaves in this way, or the device's behaviour settings are consistent with background activity. Third party app developers do not yet have the ability to override these settings.
    kennyliu likes this.
    01-06-12 01:04 PM
  22. app_Developer's Avatar
    @omniusovermind, I don't think Apple and Google were taking Windows as the model of how things should be done.

    BTW, Microsoft doesn't seem to think that either. Windows Phone 7 also limits background tasks. And the OS manages processes for you, very similarly to iOS. So even the makers of desktop Windows understand (finally) that phones are different.

    PCs have swap files. Phones don't. That's a very different constraint. Plus, with phones of course you are trying to squeeze quite a bit out of 5.000mAh. Totally different circumstance.

    The problem with quitting apps and reloading them is that uses a lot of energy. (again something different from PCs). And that is a waste of RAM that you have to power and refresh anyway. And of course, it causes *extremely* expensive calls back to the flash, something that guys who write code for servers and PCs don't fully realize sometimes.

    As for apps not behaving correctly when closed (or moved into the background), I would report that to the authors of your app. Google has good documentation and sample code showing them how they should be writing their apps to cooperate with the OS better.
    Last edited by app_Developer; 01-06-12 at 03:04 PM.
    VerryBestr likes this.
    01-06-12 01:05 PM
  23. omniusovermind's Avatar
    so you think that the reason the phone seems a little laggier towards the end of the day is due to some misbehaving apps leaving behind traces that consume resources then?
    01-06-12 01:17 PM
  24. app_Developer's Avatar
    so you think that the reason the phone seems a little laggier towards the end of the day is due to some misbehaving apps leaving behind traces that consume resources then?
    Yeah, or apps keeping services that are doing work in the background, even if it's just polling.

    My day job is to review our developers' code (and very often other company's code now, too, for some reason). And I review for issues like this (and general performance, stability, design, etc.)

    You would be shocked at the some of the stuff I see. Remember, nobody has more than 2-3 years experience with this stuff. And RIM has of course even less than that. So as someone said earlier in this thread, this is the kind of stuff the RIM team will be learning in the next year or two.
    kennyliu and omniusovermind like this.
    01-06-12 01:21 PM
  25. blackjack93117's Avatar
    Having a process is RAM in a paused state does not consume battery. It's not like you can turn the unused RAM off.

    In fact, both Apple and Google found that reloading apps from flash consumes far more energy. This is why both engineering teams choose to maximize the use of RAM. That is the smarter choice.
    I am not sure what you mean by overriding the device's behavior settings. But in Android, you get a third party app's (e.g. IM) notifications "integrated" into the OS itself (just like AppWorld notifications) and the app will be running in the background when the window is actually closed and will usually use very little of the processing power and RAM.

    I think the question about "tiny executables" should be addresses to a different poster. I never mentioned anything about executables.

    That's the point - if it's in a paused state, or minimized state ( a service) - it isn't really "running in the background" - this is not true multitasking.

    Either you have true multitasking or you give the user the impression that you do. Playbook has true multitasking, and back to the title again - apps can and DO run in the background.
    .
    Last edited by blackjack93117; 01-06-12 at 01:29 PM.
    01-06-12 01:22 PM
92 1234
LINK TO POST COPIED TO CLIPBOARD