# Start Service

> Kalipso Studio 6.1 documentation · https://doc.sysdevmobile.com/kalipso/6.1/documentation/actions/group-others/start-service
>
> Starts a Global Action Set as a background service, immediately, with a delay or periodically, with limits on Android, Win10 and iOS.

Service is a Global Action Set that you can run as a background process.

Action available for the following operating systems:

![OS Supported: Android, iOS, Win, Win32](https://doc.sysdevmobile.com/kalipso/assets/images/01_Supported_OS-5c02a51fd5080a410a07ee3ef72b6872.png)

### Parameters

* **Service** _\<numeric> -_ Select a number for a service. Can be Dynamic or 1-10.
* **Global Action Set** - Select a Global Action Set to run as a Service.
* **Start Type** _\<numeric> -_ Select how do you want to Start the Service:
  * 1 - _Immediate_ - The ActionSet will start to execute immediatly.
  * 2 - _With Delay_ - The ActionSet will start to execute after the specified delay time.
  * 3 - _Periodic_ - Similar to a Timer, the ActionSet will execute with the specified interval.
* **Cancel execution if running** _\<numeric>_
  * 1 - Yes (Used to cancel a service if it is running while reactivating the service with a call to this action)
  * 2 - No
* **Delay (ms)** _\<numeric> -_ Specified the delay or interval depending on the **Start Type**.

:::info
Calling this, will cause a service to be emulated by the current process, by running the ActionSet in a background thread. But if the project closes, the services will also stop working.
:::

:::warning
Services require Android 5.0 or later.
:::

:::info
* It is important to be aware that service executions have high limitations imposed differently by the different O.S.
* Periodic services are not ment to be executed with high frequency, they are ment to be executed for example every 1 or 2 hours.
* On Win10, the Periodic service delay cannot be lower than 15 min, and the service code will have a time limit of about 30 seconds to run.
* On iOS, only immediate services are available, and it will have a time limit of around 3 minutes after the app is suspended. It can be useful if you have some code that you want to get executed even if the user exits your App.
* On Android, the system will start to delay the Periodic timer, specially if you specified a high frequency.
* On Android you can increase the service priority and ensure it will not be likely to get suspended by using Android Foreground Services. Check **SetServiceNotification** action for more information.
:::

:::danger
VERY IMPORTANT: Do not use **User Interface** code in services. Do not open Forms, Show Message Boxes, Popups, etc. If you do, the behavior is undetermined and can cause the application to crash.
:::

:::info
Services are supposed to execute tasks in the Background. If you need to inform the application of something, you can use **PostAppNotification** action. Database and global variables are shared with the service also.
:::
