Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16066

Android: Add "foreground" service support

    Details

    • Story Points:
      13
    • Sprint:
      2018 Sprint 10 SDK, 2018 Sprint 11 SDK, 2018 Sprint 12 SDK

      Description

      Some tasks must be done in a background services but they are essential to an app (like playing audio in a music player, radio player or audiobook player). The problem is that when we use standard background services, Android can kill the service, resulting in a bad user experience.

      From the Android documentation:

      "A started service can use the startForeground(int, Notification) API to put the service in a foreground state, where the system considers it to be something the user is actively aware of and thus not a candidate for killing when low on memory." (1)

      "By default services are background, meaning that if the system needs to kill them to reclaim more memory (such as to display a large page in a web browser), they can be killed without too much harm. You can set this flag if killing your service would be disruptive to the user, such as if your service is performing background music playback, so the user would notice if their music stopped playing." (2)

      It will be very appreciated if we can use foreground services in Titanium without the need of writing a native Android module.

      1. http://developer.android.com/reference/android/app/Service.html#ProcessLifecycle
      2. http://developer.android.com/reference/android/app/Service.html#startForeground(int,%20android.app.Notification)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                dirleidionisio Dirlei Dionísio
                Reviewer:
                Gary Mathews
              • Watchers:
                36 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • It looks like Backbone Issue Sync is not enabled for your project.

                    Git Source Code