What is the Xcode “Background Processing” Background Mode?

There is no documentation yet. But in WWDC2019, they explain what it is and how to use it. Here is the link: Apple WWDC 2019 Say like you wanted to clean up your database in background to delete old records. First, you have to enable background processing in your Background Modes Capabilities. Then in your … Read more

Keep a Service running even when phone is asleep?

Note: This post has been updated to include the JobScheduler API of the Android Lollipop release. The following is still a viable way, but can be considered deprecated if you’re targeting Android Lollipop and beyond. See the second half for the JobScheduler alternative. One way to do recurrent tasks is this: Create a class AlarmReceiver … Read more

android design considerations: AsyncTask vs Service (IntentService?)

In my opinion this is the most tricky/hard part of a mainstream/average Android development. For instance on BlackBerry this is IN TIMES easier. Definitely you need to use a Service. AsyncTask does not suit, because it is tightly “bound” to your Activity via a Context handle (otherwise you would not be able to update UI … Read more

Alternative solution to HostingEnvironment.QueueBackgroundWorkItem in .NET Core

As @axelheer mentioned IHostedService is the way to go in .NET Core 2.0 and above. I needed a lightweight like for like ASP.NET Core replacement for HostingEnvironment.QueueBackgroundWorkItem, so I wrote DalSoft.Hosting.BackgroundQueue which uses.NET Core’s 2.0 IHostedService. PM> Install-Package DalSoft.Hosting.BackgroundQueue In your ASP.NET Core Startup.cs: public void ConfigureServices(IServiceCollection services) { services.AddBackgroundQueue(onException:exception => { }); } To … Read more

Run a shell script and immediately background it, however keep the ability to inspect its output

To ‘background’ a process when you start it Simply add an ampersand (&) after the command. If the program writes to standard out, it will still write to your console / terminal. To foreground the process Simply use the fg command. You can see a list of jobs in the background with jobs. For example: … Read more