throbber
6/21/2021
`
`
`Android vs. iOS Development:  
`Background Processing 
`

`Published on June 27, 2016 
`
`
`
`Matthew Casey  Follow 
`Head of Artificial Intelligence and Machine Learning at D‐CAT Digital Content Analysis 
`Technology Ltd 

`
`
`
`
`If you are building an app which needs to access resources when the user is not actively
`using the app, then you will need to do some kind of background processing. A popular
`example at the moment might be a health app which measures motion in order to track
`your activity. This all sounds very simple, but the reality is that mobile development can
`get quite complex once you want to start doing this sort of thing. We look at what is
`possible on Android and iOS.
`
`Why Background Processing? 
`
`There is one key question you should always ask if you are thinking about doing
`background processing in an app: "why?" As developers, we can probably think of lots
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`ironSource Exhibit 1011
`
`1 of 6
`
`

`

`6/21/2021
`
`of compelling reasons why we want to do things in the background. Maybe, for
`example, there is some maintenance processing we would like to do. More
`appropriately, we may want to access the device’s sensors to record activity or location
`— the most likely scenario for a health app.
`
`The reason for asking "why?" is to make sure that there really is a compelling reason to
`do background processing. Having a compelling reason means that the user is more
`likely to allow that processing to take place. For example, if you are building a game,
`why would the game want to run in the background when the user is not playing it?
`Everything that runs in the background will use up battery and processing time and
`games certainly do not get played in the background. If the user works out that your app
`is running when it does not need to, and perhaps consuming lots of battery in the
`process, then they are likely to force-quit the app or uninstall it. The operating system
`might also run out of memory, in which case it will silently kill your app.
`
`This is also true if your app wants to access sensors on the device, such as to obtain
`location information, or to track motion. We may well allow a map app to know our
`location when we are using the app, but why would we want it to track our location
`when the app is closed and we are not using the map? Not only will we not give the app
`permission to access our location all the time, we are again likely to force-quit it.
`However, if the app is tracking your daily jog to record distance, plus working out how
`much exercise you had, then we are almost certain to allow background processing. Of
`course, there are limits — if the app consumes all your remaining battery charge then it
`is likely to be uninstalled.
`
`Background Processing on Android 
`
`Overall Android is a far more liberal platform to work with. On Android, with the
`correct permissions granted, you can pretty much do whatever you need. Background
`processing when the app is paused can be achieved using a service.
`
`A service is simply a component of your app which runs without a user interface.
`Services can be configured as a processing queue — starting when needed and then
`shutting down — or as a standalone background processor. As a standard
`component, services have a context which allows them to access all of the shared
`resources for the app, as well as sensors. This means that your service could tick along
`in the background receiving location or motion updates, perhaps saving these to a
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`2 of 6
`
`

`

`6/21/2021
`
`database. They do not have a user interface, but this just means that when your app is
`next opened by the user, your app can do whatever it needs to do with the data that has
`been recorded or processed to update the display.
`
`What about when the Android device is re-booted, can you carry on background
`processing automatically? Yes. By registering a BroadcastReciever, which responds to
`the BOOT_COMPLETED intent, you can re-start your service whenever the device re-
`boots. The only thing you cannot do is stop the user killing your app, which will also
`kill the service. Once killed, the service will only re-start if you act on the re-boot
`broadcast, or if the user re-starts your app themselves.
`
`All sounds relatively easy. The problem is perhaps that it is too easy to get carried away
`and do lots in the background. Remember though, if your app uses lots of battery
`power, or seems to be doing unnecessary things in the background when your app is not
`being used, then the user is likely to force-quit it or uninstall. Think carefully what you
`do in the background and make sure you do not eat battery charge.
`
`Background Processing on iOS 
`
`This is where things get tricky. Background processing in iOS is highly regulated, with
`only certain types of background processing allowed. This is also enforced in the Apple
`review of your app to make sure you are not trying to circumvent the rules by
`pretending to do one thing, while doing another.
`
`Apple require you to present a compelling reason for doing background processing. One
`way to get some time to do some background processing is to request additional time
`when your app is being put into the background. By beginning a background task, iOS
`will give your app more time, but still expects this to be finite. Some apps do use this to
`get around background restrictions by essentially continually requesting more time.
`
`Another, and more legitimate way, to get some long-running background processing
`time is to use an appropriate background mode. For example, getting the device’s
`location while in the background is a typical background requirement for, say,
`navigation or tracking apps. To do this you need to enable the appropriate background
`mode in Xcode, request the relevant "always" permission from the user, start location
`updates when in the foreground, then do something with the location in the background.
`This location background mode can also be used as a legitimate way of obtaining
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`3 of 6
`
`

`

`6/21/2021
`
`accelerometer data, since the two normally go hand-in-hand for health apps.
`Nonetheless, to pass the Apple review, you also need to put "Continued use of GPS
`running in the background can dramatically decrease battery life" on the app’s iTunes
`listing.
`
`Following this to get background location updates will get you to the point of being able
`to do background processing. Of course, even this can be a little difficult to check as
`different iOS releases and the simulator can all behave differently when an app enters
`the background. For example, on a real device, your app will be suspended almost
`immediately after entering background mode without the correct configuration, whereas
`on the simulator, it will keep on running. Even with the correct configuration, you only
`have a limited time to complete your background processing for every location update.
`
`The issue with background processing, and particularly with using sensors, is the drain
`on the battery. Here then, you will need to tune your app to only use the GPS sensor at
`infrequent intervals to maintain low battery usage. However, even this approach will not
`solve the problem of re-starting your app’s background mode when the device is re-
`booted. Normally and app is only re-started explicitly by the user. A way around this is
`to enable one of the various sensor update modes which will automatically re-start your
`app when an update is received. For location updates, this is via monitoring significant
`location updates, which will wake up your app, but at the expense of only when the
`device has moved a significant distance from its last known location (stated as at least
`500 meters and no more frequent than every 5 minutes). Apple recommend monitoring
`significant location updates for background processing since it dramatically reduces
`battery drain.
`
`Background Processing Made Easy 
`
`These two different approaches mean that while Android is fairly straightforward to
`deal with, iOS is not. Building an app which works for both platforms is therefore more
`problematic and you have to consider the implications in your design.
`
`If you are dealing with locations (including GPS and beacons) or accelerometer
`updates, then we think we have a solution. The new Pervasive Location SDK provides a
`consistent interface to allow you to perform background processing to collect this
`sensor data without having to worry about how it all works.
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`4 of 6
`
`

`

`6/21/2021
`
`
`Background sensor data collection in the SDK is being used in a new app being
`developed for Furnace Limited and the University of Surrey to support
`a BBC4 television programme about gravity which will be broadcast next year. The app
`will use background recording of accelerometer data to calculate how much our relative
`time slows down due to the effects of acceleration as per general relativity.
`
`
`
`During November, the app will be used to find Britain’s best time traveller, with the
`winner announced in the programme. Look out for the app and measure just how much
`time travel you can do.
`
`We can help 
`
`Digital processing is at the heart of innovation. It may be that you have a difficult or
`complex problem. Pervasive Intelligence have the expertise to cut through the
`complexity to give you a solution you can use in the real world.
`
`If you would like to know more, or are interested in what support we can provide, take a
`look at what we can offer and book a free consultation. To receive similar insight, just
`follow us on LinkedIn.
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`5 of 6
`
`

`

`6/21/2021
`
`Matthew Casey  Follow 
`Head of Artificial Intelligence and Machine Learning at D‐CAT Digital Content Analysis 
`Technology Ltd 

`
`
`
`
`
`https://www.linkedin.com/pulse/android-vs-ios-development-background-processing-matthew-casey/
`
`6 of 6
`
`

This document is available on Docket Alarm but you must sign up to view it.


Or .

Accessing this document will incur an additional charge of $.

After purchase, you can access this document again without charge.

Accept $ Charge
throbber

Still Working On It

This document is taking longer than usual to download. This can happen if we need to contact the court directly to obtain the document and their servers are running slowly.

Give it another minute or two to complete, and then try the refresh button.

throbber

A few More Minutes ... Still Working

It can take up to 5 minutes for us to download a document if the court servers are running slowly.

Thank you for your continued patience.

This document could not be displayed.

We could not find this document within its docket. Please go back to the docket page and check the link. If that does not work, go back to the docket and refresh it to pull the newest information.

Your account does not support viewing this document.

You need a Paid Account to view this document. Click here to change your account type.

Your account does not support viewing this document.

Set your membership status to view this document.

With a Docket Alarm membership, you'll get a whole lot more, including:

  • Up-to-date information for this case.
  • Email alerts whenever there is an update.
  • Full text search for other cases.
  • Get email alerts whenever a new case matches your search.

Become a Member

One Moment Please

The filing “” is large (MB) and is being downloaded.

Please refresh this page in a few minutes to see if the filing has been downloaded. The filing will also be emailed to you when the download completes.

Your document is on its way!

If you do not receive the document in five minutes, contact support at support@docketalarm.com.

Sealed Document

We are unable to display this document, it may be under a court ordered seal.

If you have proper credentials to access the file, you may proceed directly to the court's system using your government issued username and password.


Access Government Site

We are redirecting you
to a mobile optimized page.





Document Unreadable or Corrupt

Refresh this Document
Go to the Docket

We are unable to display this document.

Refresh this Document
Go to the Docket