Improved iPhone "WebApps" = iPhone multitasking ??

Discussion in 'iPhone' started by ArtursBoy, May 26, 2009.

  1. ArtursBoy macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #1
    Okay so we all know by now the Palm Pre multitasks, and we all know that Pre (WebOS) uses applications written in browser-supported languages such as Java, HTML, etc.

    We all also remember the iPhone's "WebApps" introduced a while back, these were applications written also in browser-supported languages. These were simple apps such as simple games, social networking apps, a few news readers, etc. The problem with these apps was that most of them needed to have a live connection to the internet, and seemed to function as fast as the internet connection would allow.

    So here's my thought, why not improve on the idea of these WebApps, make them work more like a regular apps (install the actual code on the device, have deeper access to OS, basically be allowed to have access to the full functionality of the phone). Apple could allow users to download/buy them from their AppStore alongside the regular apps. This seems to me like a good alternative, a developer could choose whether to create a "WebApp" or a regular app for the iPhone knowing that regular apps could be more powerful, as would be the case for games, but cannot run in the background (just use the push notification service), or create a simpler webapp, that while not as powerful as a regular app, it could be allowed to run in the background. And the user could purchase them knowing which is a "WebApp" and which is a regular app, it'd be up to the user to decide if the want a "more powerful" app, or an application that is able to run in the background.

    From what I'm reading, while not exactly identical, WebApps on iPhone and applications on WebOS (Palm Pre) are somewhat similar (since they can both be written in the same language), so if an application can be made to say stream audio on WebOS, it should also be possible for a WebApp for iPhone to perform the same functions right?

    So how about it Apple? You still get to limit background processes for apps that need alot of resources, implementing your push notification service for those applications, and allow "simpler" WebApps that dont necessarily need alot of resources to run in the background and behave more like regular apps.

    I'm not a developer, so I'd love to hear from those who do this for a living what they think about Apple doing something like this.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    A Web App needs a browser to run in (to provide execution services for Javascript as well as display for HTML/dynamically created content via the DOM). So each Web App needs a copy of Safari running (or to share a copy between them). This is more resource intensive than small native app, not less so your proposal pretty much dies there.
     
  3. ArtursBoy thread starter macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #3
    Thanks for clearing that up, that makes sense.

    Just out of curiosity, so for something like this to work and use less resources, Javascript execution and displaying of dynamically created content would have to be more of a system wide feature, if you want to call it that ? Would designing an OS with a browser that's "always on" be a idea?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    It would be a fundamental re-architecting of the iPhone OS. I just don't see it happening. If Apple ever allow background apps they will be fully native, Objective-C based apps with strict memory/CPU usage limits and probably a restricted API. Running a browser in the background just sucks up CPU and memory.
     
  5. kas23 macrumors 603

    kas23

    Joined:
    Oct 28, 2007
    #5
    But, would running multiple Web Apps be anymore resource intensive than having multiple windows of Safari running?

    It would be cool to have a Pandora Web App. At least you would then be able to listen to Pandora and surf the web at the same time.
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    Can you listen to Pandora right now in Safari? My understanding is that you can't as Safari does not allow plugins. So if these hypothetical web apps allowed this then yes, that would be significantly more resource intensive than a page in the current Safari app. Also I'm not sure Safari runs Javascript on none-front pages so again if you had multiple web-apps running, even if they shared a container instance of Safari then that would be much worse than the current situation. Note that web Safari is running it uses the whole system: it can't run in the background as it uses so much CPU and memory. Basically this is all pie-in-the-sky. If background apps are ever allowed they'll have to be native.
     
  7. kas23 macrumors 603

    kas23

    Joined:
    Oct 28, 2007
    #7
    No, you can't listen to Pandora via Safari. If you go to their website, it directs you to a page telling you to download the app. I'm not sure about Javascript running on non-front pages. As for Safari running in the background, I was under the impression that it runs in the background anyways (to some degree).

    This is why it would be ideal to make awesome/useful Web Apps, because by definition, they would be allowed to run in the background. We would be able to flip through different Web Apps much in the same way we flip through multiple Safari pages. In fact, if this is how the whole GUI was, it would be cool.
     
  8. t0mat0 macrumors 603

    t0mat0

    Joined:
    Aug 29, 2006
    Location:
    Home
    #8
    What is the actual resource use for running Safari? So Safari doesn't run in the background, and is only on when the user or a program calls it, and then is shut down when they stop using it/ hit the home button and go onto something else?
    I still see Apple having a hand in something akin to what the OP is talking about - why wouldn't they? They're working with SproutCore etc, so why not look at slimlining Safari, making it good enough to be a background process, and then run SproutCore like apps - suspend those that don't need to be active when you're not directly using the browser/apps.

    Presumably running iTunes in the background "sucks up CPU and memory", but it's the user's choice to have it running. Ruling out something just because it uses CPU and memory seems like only a temporary solution - once you've increased the CPU 50%, and doubled the memory, you have more headroom. Yes, it might use more battery, but then that's the user's choice - just like when they have Maps app active and are wearing the battery down.
    To take one of kas23's point - seeing the simple HTML5 demos using pictures to get a coverflow implementation, it's not too much of a leap to think of a Coverflow implementation of web apps/web pages - coverflow screens, versus cards.
    Would Apple go and rearchitect Safari to be more like Chrome (which Firefox has yet to do also) so that additional tabs/pages don't increase resource usage linearly? I don't see why you couldn't using HTML 5 actually make your own CoverFlow for live web pages, that refresh, using a main page that has predetermined pages to use chosen by you, and then implement them onto a coverflow view. If you could change your default homepage for newly opened tabs, that'd be a start.
     
  9. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    I agree with all that. What I've been trying to do is clear up what appears to be a misconception that somehow web-apps will solve all this. They are worse, not better than native apps in terms of the resources required to allow them to run in the background, execution speed, basically everything.

    I fully expect background apps to come along at some point, although I suspect never officially to current hardware: next gen hardware with much more RAM and faster CPU will probably be required by Apple. This will be a nice way for them to tempt you to upgrade...
     
  10. Eso macrumors 68000

    Eso

    Joined:
    Aug 14, 2008
    #10
    First of all, Safari doesn't really "run" in the background. All it does it keep your current pages cached in memory as long as other services don't need it. This allows you to quit safari, use the calender (for example), then come back to safari and your page won't have to load again. If the memory is needed, however, you'll have to reload the page which often happens even within safari itself when switching between browser pages.

    I doubt it has much memory for safari content either, as it often reloads "simple" pages. Everything you need to view macrumors.com is 500 KB - compare to the iPod which uses 30 MB in the background.
     
  11. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #11
    Given the competition that the Palm Pre may give with their web apps, I hope apple will open up the iPhone more to allow developers better access to the hardware.
     
  12. TheSpaz macrumors 604

    TheSpaz

    Joined:
    Jun 20, 2005
    #12
    Actually... Safari does run in the background. If you use an app like FreeMemory, you can see what apps are running and Safari is definitely running if you have a webpage loaded. The only way to kill Safari is to force it to shut down by holding the home button or create a new page and close the old one.
     
  13. Saladinos macrumors 68000

    Saladinos

    Joined:
    Feb 26, 2008
    #13
    I think Apple will be improving iPhone webapps, including javascript options that allow for access to hardware features.

    For example, the iPhone 3.0 version of Safari supports the new javascript geolocation objects, which allows all kinds of GPS-enabled web applications to be created.
     
  14. ArtursBoy thread starter macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #14
    Maybe I didn't explain myself clearly enough. I didn't mean WebApps to be a solution with the current iPhone OS configuration. Like you mentioned, if Safari takes up so many resources, then this solution would clearly not work as it would be better to have native apps running instead. But what if the OS was reworked with this in mind? Allow plug-ins in Safari (as it does on the desktop version), etc, or allow the OS itself to be able to understand "browser language" (if that's even possible). As you mentioned, a re-architecture of the OS would be needed, but if Apple didn't think WebApps were a good idea, they wouldn't have introduced them as their only kind of apps at the beginning. Restructuring the OS to be able to work this way would allow Apple to keep their current apps content and still allow it to grow, while at the same time giving users the option to run multiple apps at once with select apps (webapps).

    This is all just hypothetical thinking on my part, and as I mentioned before, I'm not a developer, I'm just pondering on what a solution for multitasking might look like if they insist on preventing native regular 3rd party apps from running in the background. :)
     
  15. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #15
    Ultimately HTML+Javascript+CSS (ignoring the mess that is Flash etc) are higher overhead than native compiled Objective-C. At a basic level it comes down to interpreted code versus compiled code (see Wikipedia as required). I simply don't see what the fascination with WebApps is. Native apps are clearly a better option for background apps and they are not allowed. I cannot see any reason Apple would put the effort required into allowing WebApps to run in the background before they allow well written native apps to run in the background. I actually see little point in WebApps at all. Native apps are simply a better, more optimised solution.
     
  16. newConvert macrumors regular

    Joined:
    Aug 25, 2006
    #16

    you CAN already do this... its called phonegap. It allows you to write apps in javascript, and have access to some of the native iphone functions.

    The only problem with this is apple has been rejecting some of the apps due to it using an "unauthorized 3rd party api" which is BS, because it only uses document objective c API's..
     
  17. bigmouth macrumors 6502

    Joined:
    Jul 24, 2008
    #17
    I have background processing via jailbreak. Safari is a MASSIVE memory hog already. I don't use Pandora, but I stream audio regularly with Tuner, FStream, and WunderRadio. If even one window of Safari is open, I have trouble opening a stream due to memory limitations. This won't work unless they increase RAM.
     
  18. ArtursBoy thread starter macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #18
    Well, seeing as how for example, Windows Mobile, even BlackBerry OS slow down when multiple apps are running (native apps), compare that to how WebOS can supposedly multitask with its "web apps" (from what is seen on videos, presentations, etc), also knowing that the apps on WebOS are built on browser language, and seeing how Safari on iPhone is allowed to have multiple webapps present, it is easy to assume that maybe these webapps are "light" enough to allow them to stay on without taking up too many resources, and that maybe these native apps do slow the phone down when multiple are running.

    So it's not that I'm fascinated with webapps, it's just that if these apps can be the solution for the multitasking problem, then I'm all for it. Yes, maybe a well written native app does not slow the phone down too much, but maybe the problem is that not all native apps are well written, and for some apps it may be impossible to not use alot of resourses (games). One would have to keep these apps in check manually to keep them from slowing the phone down too much (as in Windows Mobile or BlackBerry). It seems to me that if Palm can make these "webapps" work to their advantage, so can Apple, since Apple actually introduced them a while back as their only solution.
     
  19. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #19
    WebOS is not multi-tasking really. It's running a single application (the web browser). This is fundamentally different to the iPhone. If Apple chose to totally re-architect the iPhone OS from the ground up to be like this (making all existing native apps not work at all) then that would be fine. But they are not going to. Small, constrained native apps will, I'm sure, eventually be allowed to run in the background.
     
  20. ArtursBoy thread starter macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #20
    I see what you're saying.

    What about building a "layer" on top of the core OS that can "understand or translate" browser language only when necessary? wouldn't something like this allow native and webapps to be ran natively side by side?
     
  21. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #21
    That's called Safari. That's what it does. And it's really very memory and CPU intensive.
     
  22. ArtursBoy thread starter macrumors member

    Joined:
    May 7, 2008
    Location:
    AZ
    #22
    I understand your point of view, but its not necessarily what I had in mind...
     

Share This Page