ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #03771
Re: Running background services
On Wed, Aug 14, 2013 at 11:31 AM, Michael Zanetti
<michael.zanetti@xxxxxxxxxxxxx> wrote:
> On Wednesday 14 August 2013 10:33:34 Thomas Voß wrote:
>> The state of an application is transparent to the user. Behind the
>> scenes, the system can decide to stop/kill non-focused apps at its own
>> discretion. Whenever the system alters the state of an app to "not
>> running" it offers an archive such that the app can persist its state.
>> With that, a user ideally never realizes that an app has been stopped
>> or killed.
>
> Take for example this use case:
>
> A remote control application for a media center might have a feature to pause
> the running movie/song/whatever in case of an incoming phone call. This
> obviously only works while the application is running and will break when the
> app gets paused.
>
> Another one: A sports tracker tracks my way while running. I still want to
> listen to music while running and have the music app focused. If that kills
> the sports tracker app this won't work.
>
> I guess both use cases could be implemented by the app starting a background
> task for that given job and stop the background task again when it is closed
> by the user (as opposed of being suspended/killed by the system) or when the
> user manually stops the task (disconnect from media center, stop sports
> tracking etc).
>
Sure, version 2 will see that sort of functionality being enabled for
apps. However, being smart about when to kill the background service
is the really interesting bit. Having it running all the time is not
an option, we could as well allow the app to run in that case. From my
pov, assuming that an app will be well-behaved is very dangerous and
as noted earlier: the platform is ultimately responsible, not the app.
Thomas
> Thanks,
> Michael
>
>>
>> Thomas
>>
>> On Wed, Aug 14, 2013 at 10:08 AM, Tobias Havla <tbhavla@xxxxxxxxx> wrote:
>> > On 14.08.2013 10:04, Thomas Voß wrote:
>> >> On Wed, Aug 14, 2013 at 9:56 AM, Tobias Havla <tbhavla@xxxxxxxxx> wrote:
>> >>> On 14.08.2013 09:54, Thomas Voß wrote:
>> >>>> On Wed, Aug 14, 2013 at 9:41 AM, Michael Zanetti
>> >>>>
>> >>>> <michael.zanetti@xxxxxxxxxxxxx> wrote:
>> >>>>> On Wednesday 14 August 2013 09:31:31 Daniel Holbach wrote:
>> >>>>>> Hello,
>> >>>>>>
>> >>>>>> On 14.08.2013 09:29, Michael Zanetti wrote:
>> >>>>>>> On Wednesday 14 August 2013 09:07:52 Thomas Voß wrote:
>> >>>>>>>> Hey Fabio,
>> >>>>>>>>
>> >>>>>>>> no, applications are not allowed to run in background. Our
>> >>>>>>>> application
>> >>>>>>>> lifecycle is strict in this respect and we only guarantee focused
>> >>>>>>>> applications to be running.
>> >>>>>>>
>> >>>>>>> Does that mean I will have an Ubuntu Edge phone with 4GB of RAM, 8
>> >>>>>>> CPU
>> >>>>>>> cores and cannot do multitasking on it?
>> >>>>>>
>> >>>>>> I don't think anyone specified the phone to have 8 CPU cores - where
>> >>>>>> did
>> >>>>>> you read that?
>> >>>>>
>> >>>>> Nowhere... I think you get my point...
>> >>>>>
>> >>>>>> How is "app authors can write daemons" = multitasking?
>> >>>>>
>> >>>>> How does this relate? Thomas said there will be no running apps in the
>> >>>>> background / minimzed apps, which to me means there will be no
>> >>>>> multitasking.>>>>
>> >>>> We have had this conversation multiple times in the past, and version
>> >>>> 1 of our application lifecycle will not allow to run arbitrary
>> >>>> applications in the background. Instead, we will provide selected
>> >>>> services to hand over to the system for certain tasks, e.g.,
>> >>>> downloads, alarms, music playback. Please note that this is a policy
>> >>>> targetted towards the "mobile phone" usage scenario and swapping
>> >>>> policies at runtime when transitioning to different usage scenarios is
>> >>>> one of the primary goals of the lifecycle architecture.
>> >>>>
>> >>>> Version 2 of the lifecycle will then allow applications to run their
>> >>>> own background tasks, UI less, with restrictions on
>> >>>> CPU/Memory/resources in general.
>> >>>>
>> >>>> Thomas
>> >>>>
>> >>>>> --
>> >>>>> Mailing list: https://launchpad.net/~ubuntu-phone
>> >>>>> Post to : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>> >>>>> Unsubscribe : https://launchpad.net/~ubuntu-phone
>> >>>>> More help : https://help.launchpad.net/ListHelp
>> >>>
>> >>> If Ubuntu Touch doesn't support multi task it is far behind iOS,
>> >>> Android, Windows Phone and Blackberry. Sorry, I thought it would be a
>> >>> modern system that requires a lot of power, so we can do the same things
>> >>> as on our PCs.
>> >>
>> >> Okay, let's be clear here: Multitasking and application lifecycle are
>> >> related but distinct topics. Obviously, Ubuntu Touch will support
>> >> multi-tasking, but an application lifecycle architecture that allows
>> >> for controlling resource consumption of applications by the system is
>> >> sorely needed to ensure a long-running _mobile_ device. It is not
>> >> sufficient to assume that app authors will get it right and it is
>> >> important to note that users always "blame" the platform for bad
>> >> battery life. And that is for a good reason: It's the platform's/OS's
>> >> responsibility to put mechanisms in place to manage a device's
>> >> resources!
>> >>
>> >> Our application lifecycle policies and state machines allow us to
>> >> exercise this level of control for specific usage scenarios, but they
>> >> do not touch on general multi-tasking capabilities and we can leverage
>> >> the full process state spectrum to ensure a seamless operation.
>> >>
>> >> Thomas
>> >
>> > So can two or three applications run at the same time and other gets
>> > closed/suspended or can I switch between two applications only with
>> > reloading the application?
>> > We have a gesture to quick switch between apps, so if we have to reload
>> > apps while we are multitasking this gesture makes no sense. A good way
>> > would be suspending apps like Android does (/Greenify). The doesn't
>> > notice that and the battery life is good.
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help : https://help.launchpad.net/ListHelp
References