A background service is a computer service that runs "behind the scenes" (i.e. in the background) and without user intervention.
Questions tagged [background-service]
889 questions
17
votes
4 answers
How to restart service after the app is killed from recent tasks
I have created a service to fetch current location of the device in periodic intervals. I want the service to run in the background even if the app is cleared from recently opened apps. Currently the service runs in background only until app is…

Arindam Dawn
- 1,769
- 2
- 18
- 35
17
votes
4 answers
Is there any equivalent of Services of Android in iOS?
I want to check the database in my app every 12 hrs for rows with date column having corresponding date. This is accomplished by writing service in android. But is there any equivalent of services in iOS so that my requirement can be accomplished?

viks
- 404
- 2
- 6
- 14
16
votes
3 answers
Exception thrown from task is swallowed, if thrown after 'await'
I'm writing a background service using .NET's HostBuilder.
I have a class called MyService that implements BackgroundService ExecuteAsync method, and I encountered some weird behavior there.
Inside the method I await a certain task, and any…

TheDotFestClub
- 180
- 1
- 7
16
votes
1 answer
How to keep Bluetooth connection background?
I have created a Bluetooth Activity class in the android app, which works fine for all the Bluetooth functionalities like: scanning, pairing, connecting, sending and receiving data.
The real problem is when the Activity is destroyed. Bluetooth is…

Bhanu Prakash Pasupula
- 962
- 2
- 9
- 25
14
votes
6 answers
How to run clock timer in background on flutter?
I am trying to develop a timer app in Flutter that includes multiple countdown timers for different tasks. However, I'm facing an issue where if I start a timer and then press the back button, the timer stops. I want the timer to continue running…

Tushar Asodariya
- 629
- 2
- 7
- 20
14
votes
1 answer
How to set alarm in Flutter?
I am working on an alarm app. I want to know that how can I set the alarm in flutter app as in the android we use alarm manager to trigger alarm function. Need for both platform Ios and Android.

sagar dhiman
- 293
- 2
- 11
14
votes
4 answers
keeping background service alive after user exit app
I'm trying to create a service that will do background jobs for me even after the user closes the app from the running processes menu(by shifting process out of the screen).
What I tried to do is create service in a different process by declaring it…

Nativ
- 3,092
- 6
- 38
- 69
13
votes
3 answers
How to cancel manually a BackgroundService in ASP.net core
I create a BackgroundService like this:
public class CustomService : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
{
do
{
//...
await…

Mehdi
- 903
- 3
- 10
- 26
13
votes
1 answer
IHostedService usable in Azure Functions App?
Regardless of whether we should, can we use IHostedService in an Azure Functions App?
Here is an attempt to register a hosted service (background service, specifically) as IHostedService:
internal sealed class Startup : FunctionsStartup
{
public…

Timo
- 7,992
- 4
- 49
- 67
13
votes
7 answers
scheduling alarm for every second in android 5.1
I want to run alarm service for every second in my application.It is working fine below 5.1 version. but it is not triggering in 5.1 devices. I am using commonsware wakeful intent service.The logcat message is saying that "Suspiciously short…

Chaitu
- 907
- 2
- 13
- 27
13
votes
3 answers
Can a background service exist without its main application?
Lets examine the next scenario:
I created a new android app, with an application class, activity and a background service.
I have some static variable in the application class, lets say it's an int i = 0;
I start the activity, and start the…

Slava Kamzen
- 519
- 4
- 18
12
votes
3 answers
Running background task on demand in asp.net core 3.x
I'm trying to start a background task on demand, whenever I receive a certain request from my api end point. All the task does is sending an email, delayed by 30 seconds. So I though BackgroundService would fit. But the problem is it looks like the…

Yehia A.Salam
- 1,987
- 7
- 44
- 93
12
votes
1 answer
EF Core DBContext inside Net Core Worker Windows service
what I am trying to achieve is code a simple .net core background worker (.net core 3.1) where I write data to a SQL Server database (through EF Core 3.1) while this worker is running as a windows service.
When I run the below code from Visual…

Kenneth
- 181
- 1
- 1
- 7
11
votes
3 answers
access BackgroundService from controller in asp.net core 2.1
I just need to access my BackgroundService from a controller.
Since BackgroundServices are injected with
services.AddSingleton()
How can I use it from a Controller class?

Alex Troto
- 651
- 6
- 18
10
votes
2 answers
shared preferences not working in the background in flutter
i am using shared_preferences: ^2.0.7 with flutter_background_service: ^0.1.5 in flutter
but when call shared preferences give me the error
"Flutter: Unhandled exception: MissingPluginException(No implementation found for method getAll on channel…

Ahmed El-Shingiti
- 111
- 6