1. Sign-up to become a member, and most of the ads you see will disappear. It only takes 30 seconds to sign up, so join the discussion today!
    Dismiss Notice

What Can an App Do in the Background?

Discussion in 'Apple' started by Johnny Angell, Aug 23, 2019.

  1. Johnny Angell

    Johnny Angell Played With Dinosaurs Member

    Joined:
    Dec 13, 1998
    Messages:
    10,905
    Likes Received:
    3,368
    Trophy Points:
    9,110
    Location:
    Central Arkansas
    Real Name:
    Johnny Angell
    I use MyMovies Pro to catalog my discs. I use my iphone to scan the bar code of the disc and I’m done. Except for the version I have on my iPad Pro. The way the app keeps the ipad in sync is to download my entire data base of discs, which takes close to 10 minutes.

    What is bad about that is the app has to remain in the foreground. If I bring up another app or close the ipad, the download stops. That’s rather inconvenient. I wrote the developer via support request and within 2 hours I had a reply. He said apple requires that only small things be done in background and downloading my dB of movies is not a small thing.

    Well apple violates that with their App Store and doing app updates which can take a long time. Of course, he who makes the rules can violate them when they want. However, I don’t buy the developer’s answer. Something like this is made for the background.

    I will go on to say that I love the app and will continue using it. That 2 hour response time is typical, and is often faster. Props to the developer.

    Are there apps that do heavy duty work in the background?
     
  2. DaveF

    DaveF Moderator
    Moderator

    Joined:
    Mar 4, 2001
    Messages:
    21,819
    Likes Received:
    3,499
    Trophy Points:
    9,110
    Location:
    Catfisch Cinema
    Real Name:
    Dave
    Im not current. But for a while, there was a 99 second limit on background processing of tasks in iOS. I've not checked to see what the current situation is. I know that Overcast, my podcast app of choice downloads in the background fine. I can toggle in and out of Audible and it downloads books as I do that.

    But for apps doing big things, like syncing my media library, I just leave them to their business. Similarly to Netflix or Amazon downloading videos, I let them do it in the foreground to avoid problems. I don't know how much is real and how much is Cargo Cult behavior on my part. :)
     
    Johnny Angell likes this.
  3. Johnny Angell

    Johnny Angell Played With Dinosaurs Member

    Joined:
    Dec 13, 1998
    Messages:
    10,905
    Likes Received:
    3,368
    Trophy Points:
    9,110
    Location:
    Central Arkansas
    Real Name:
    Johnny Angell
    Thanks for the reply. I’ve not heard that expression before, what does it mean?
     
  4. DaveF

    DaveF Moderator
    Moderator

    Joined:
    Mar 4, 2001
    Messages:
    21,819
    Likes Received:
    3,499
    Trophy Points:
    9,110
    Location:
    Catfisch Cinema
    Real Name:
    Dave
    “Cargo cult science is a phrase describing practices that have the semblance of being scientific, but do not in fact follow the scientific method.”
    https://en.m.wikipedia.org/wiki/Cargo_cult_science

    Doing a thing that has the structure or form of effective and technical process, but doesn’t actually accomplish what’s desired, is another way to think of it.

    I think people constantly killing all their apps immediately after using them is similar to this sort of personal gadget cargo cult behavior. :)
     
  5. Thomas Newton

    Thomas Newton Screenwriter

    Joined:
    Jun 16, 1999
    Messages:
    1,860
    Likes Received:
    246
    Trophy Points:
    1,610
    It looks to me as if the developer is familiar with at least some of Apple's guidelines:

    "The current state of your app determines what it can and cannot do at any time. For example, a foreground app has the user’s attention, so it has priority over system resources, including the CPU. By contrast, a background app must do as little work as possible, and preferably nothing, because it is offscreen."

    https://developer.apple.com/documentation/uikit/app_and_environment/managing_your_app_s_life_cycle

    There are also guidelines regarding fetching content "opportunistically" in the background; additional guidelines that are probably more to your liking:

    https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/updating_your_app_with_background_app_refresh

    I believe these say that the third-party app could download the database of movies in the background, if it did so in small chunks, being careful not to interfere too much with the performance of the foreground application. The app would need to gracefully handle being killed in the middle of a background download, and restarted later. After all, when iOS runs out of memory, it doesn't page to "compressed RAM" or disk. It asks running apps to give back some memory, and if it doesn't get enough, it kills them until it gets what it needs.
     
  6. Johnny Angell

    Johnny Angell Played With Dinosaurs Member

    Joined:
    Dec 13, 1998
    Messages:
    10,905
    Likes Received:
    3,368
    Trophy Points:
    9,110
    Location:
    Central Arkansas
    Real Name:
    Johnny Angell
    Well, if I use another app, Movies Pro stops the download but doesn’t lose what it has done. Same if I close my ipad. Seems he could do this in the background also.
     
  7. DaveF

    DaveF Moderator
    Moderator

    Joined:
    Mar 4, 2001
    Messages:
    21,819
    Likes Received:
    3,499
    Trophy Points:
    9,110
    Location:
    Catfisch Cinema
    Real Name:
    Dave
    Maybe? I don't really understand the current abilities and limitations of background downloading. It seems Overcast downloads stuff i the background pretty well. But 50MB podcasts take about a minute or less (over wifi). I've not tested Audible to see where it breaks in the 5-10 minute book download (they're hundreds of MB typically). And when I download videos, I'm often queuing 1GB to 2GB of downloads that will take 10 to 30 minutes, so I leave the iPad on and Netflix downloading while I do other stuff to ensure it gets done.

    Here's some more info about background app downloading. A takeaway is the explicit example is about transferring 500 kB of data, small stuff like a weather app might do.
    https://developer.apple.com/documentation/foundation/url_loading_system/downloading_files_in_the_background

    There's also the difficulty and money required for a small developer to add new features to their app. These movie database apps are very niche, I assume (I use MovieBuddy+), so the developer has to be extra judicious in focusing on key features that serves the most users and help bring in new users.

    So email him about background downloads. Add your voice to the feature request. You might not be the only one and might prompt them to explore and improve the syncing features. :)
     

Share This Page