Is it possible to keep my app running in the background even when user closed it?

Is it possible to keep my app running in the background even when user closed it?

  

Hi everyone, 

I am creating a fitness app with pedometer feature. 

However, I am having trouble with the following issue:
1. I am using Background Mode plugin, but it still does not fulfill my use case. I need my app to stay alive even when the user "close/kill" the application.

One application exists in the play store is called pacer... is outsystems able to create something similar?

Hi olivier,

               Indra is right your can use the timer.



Thanks

Rajendra Singh

                             

Hi Olivier,

What exactly are you trying to achieve? If a user kills an app, it will not be running on the device and OutSystems Timers only exist server-side.

If you're ok with the app running in the background when the user switches apps (or soft-closes your app, without explicitly "killing" it) you may want to check this post and use something like BackgroundMode Plugin or Background Location Plugin, depending on what you need.

Jorge Martins wrote:

Hi Olivier,

What exactly are you trying to achieve? If a user kills an app, it will not be running on the device and OutSystems Timers only exist server-side.

If you're ok with the app running in the background when the user switches apps (or soft-closes your app, without explicitly "killing" it) you may want to check this post and use something like BackgroundMode Plugin or Background Location Plugin, depending on what you need.

Hi Jorge, 

I am trying to keep my app always alive in the background. (Even when the user did not open the app). So that my pedometer would "run" continuously. 


The scenario that i could envision is..  

1. Track user step taken throughout the day.

(i can only do that if my app is running / pedometer in the background

2. Set a timer and sync it at 11:59pm daily to the local db. 


Olivier,

Please look into this plugin which from the description uses this Cordova plugin for the pedometer functionality. This kind of thing is provided by the device/OS itself, it's not something you can easily do directly from your app.

If you want to share that data via HealthKit on iOS, you can look into this other plugin.

Hello Olivier,

What you are trying to accomplish is to build a Service.

https://developer.android.com/guide/components/services.html

You can search for service and cordova to find documentation on how to implement a service with cordova and try to adapt to use in a plugin for an OutSystems app. Not sure if it is really doable.

Not sure if it is possible at all in iOS.

The easiest would be to implement a small service with native code and launch it through a plugin.

Cheers