background-process

How to keep a service alive using AlarmManager.setInexactRepeating()?

狂风中的少年 提交于 2020-08-10 08:25:06
问题 I have some existing code that spawns a service intent which does a bunch of stuff in the background. This code does work... Intent serviceIntent = new Intent(context, APMService.class); serviceIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startService(serviceIntent); My question is: how to change this to use the AlarmManager.setInexactRepeating(...) methods? I have changed the above code to this: Intent serviceIntent = new Intent(context, APMService.class); serviceIntent.putExtra(

Rails making new cron jobs based on user input

橙三吉。 提交于 2020-06-28 05:06:30
问题 In my application, I want to invoke an action every two weeks based on when the user triggered an action. I guess what's confusing is why there doesn't seem to be a straight forward way of doing this. Ideally, the repeated job would be set in the model , not some other file . For example, the whenever gem has these instructions: Getting started $ cd /apps/my-great-project $ wheneverize . This will create initial config/schedule.rb file for you. But I don't want to put my schedules in there. I

Never Ending Background Service - Java for Android

我与影子孤独终老i 提交于 2020-06-01 06:43:46
问题 I wanted to make this service a never ending service, even if the app is killed by the user. That service starts with the app - when it is background, the service still runs-, but when I clear the background tasks on phone, it is also killed. I wanted that final part to be different, wanted this service to keep running on the device... Is that possible? Thanks for the help public class BackgroundService extends Service { public static Runnable runnable = null; public Context context = this;

How to send location data to Firestore Database when app is killed in FLUTTER

丶灬走出姿态 提交于 2020-05-28 08:03:05
问题 I have been trying to create an app in flutter which sends the location data of a user to the Firestore Database EVEN WHEN THE APP IS KILLED. This plugin works well to get the location data when the app is killed: https://github.com/rekab-app/background_locator The problem is that I am unable to update the Firestore Database values in the 'callback' function of this plugin Here is my code: static void callback(LocationDto locationDto) async { print('location in dart: ${locationDto.toString()}

How to send location data to Firestore Database when app is killed in FLUTTER

倖福魔咒の 提交于 2020-05-28 08:02:25
问题 I have been trying to create an app in flutter which sends the location data of a user to the Firestore Database EVEN WHEN THE APP IS KILLED. This plugin works well to get the location data when the app is killed: https://github.com/rekab-app/background_locator The problem is that I am unable to update the Firestore Database values in the 'callback' function of this plugin Here is my code: static void callback(LocationDto locationDto) async { print('location in dart: ${locationDto.toString()}

How to constantly run Python script in the background on Windows?

僤鯓⒐⒋嵵緔 提交于 2020-05-07 19:31:09
问题 I have created a script that moves files from one folder to another. But since the original folder is the Downloads folder I need it to always run in the background. I also have a standard Batch file that looks something like this: @py C:\\Python\Scripts\moveDLs.py %* I'm using Windows 10 . I have found info for Linux and OS on how to use nohup in the batch file. Is there a Windows version? If there is do you need to execute the script every time you restart or switch the PC on? Also, how do

Xamarin Forms - Get device location every 10 seconds (when app runs in foreground/background)

旧时模样 提交于 2020-04-07 09:27:38
问题 I have created a xamarin forms application. The application should periodically (every 10 sec) get the location of the device (IOS and Android). How can I achieve this? I know there are some libraries for example: Xamarin.Essentials, but I can't decide how many times the location should be taken. It should also be possible to get the local of the device when the xamarin forms application runs in the background (on IOS and Android). Hope someone can help me out with this one. 回答1: For Android

Xamarin Forms - Get device location every 10 seconds (when app runs in foreground/background)

ⅰ亾dé卋堺 提交于 2020-04-07 09:27:23
问题 I have created a xamarin forms application. The application should periodically (every 10 sec) get the location of the device (IOS and Android). How can I achieve this? I know there are some libraries for example: Xamarin.Essentials, but I can't decide how many times the location should be taken. It should also be possible to get the local of the device when the xamarin forms application runs in the background (on IOS and Android). Hope someone can help me out with this one. 回答1: For Android

Xamarin Forms - Get device location every 10 seconds (when app runs in foreground/background)

女生的网名这么多〃 提交于 2020-04-07 09:27:22
问题 I have created a xamarin forms application. The application should periodically (every 10 sec) get the location of the device (IOS and Android). How can I achieve this? I know there are some libraries for example: Xamarin.Essentials, but I can't decide how many times the location should be taken. It should also be possible to get the local of the device when the xamarin forms application runs in the background (on IOS and Android). Hope someone can help me out with this one. 回答1: For Android

Running background task on startup

流过昼夜 提交于 2020-03-18 08:25:27
问题 I'm writing an iOS app that uses the Dropbox Datastore API to sync data across multiple devices. On Android, I'm able to tell the service to start on boot, which enables it to sync any changes that may have occurred whilst the device was turned off. I'm having trouble finding a definitive way to have my app do the same on iOS. So, does anyone have any recommendations to: Run a simple background service efficiently and dependably on iOS. Have the service start at boot This must be possible -