background-process

SWIFT: how to run a function even when user kills the app

落爺英雄遲暮 提交于 2019-12-12 19:16:44
问题 I am using swift 2 and Xcode7 for iOS9. I want to know if I can maintain a function (that checks for something to delete) running "forever" even if the user kills the app? I am deleting contacts from the contact list according to some rules and time. It is running ok, but just with the app opened or in second plan. I want to make this app capable to delete those contacts even when the user kills it. 回答1: You can use background thread when user opens the app. But if the app will be terminated,

How to download multiple mp4 file in background with progress in iOS?

穿精又带淫゛_ 提交于 2019-12-12 16:55:33
问题 I stuck from last 2 days on this issue. please help me out. My requirement is, if I downloading a file in background in second view controller and after download starting I pop to 1st view controller and If I again push to 2nd view controller then that progress should be continue. Here what happening : I push to second view controller. I started Download using NSMutableURLRequest , NSURLConnection . If I pop to 1st view controller and again go to 2nd view controller then all are showing 0.

What is the difference between forking and threading in a background process?

拥有回忆 提交于 2019-12-12 12:11:01
问题 Reading the documentation for the spawn gem it states: By default, spawn will use the fork to spawn child processes. You can configure it to do threading either by telling the spawn method when you call it or by configuring your environment. For example, this is how you can tell spawn to use threading on the call, What would be the difference between using a fork or a thread, what are the repercussions of either decision, and how do I know which to use? 回答1: Threading means you run the code

How to kill background process from system function call

强颜欢笑 提交于 2019-12-12 10:57:43
问题 How can I kill a background process that was executed using a system function call in C language. Like for example I have a compiled application call "fooprocess". Then I want to write a program that will execute the fooprocess application in the background using the system function, please kindly see below the code, const char app[] = "fooprocess &"; system(app); As you can see there is a "&" character so that I can run the fooprocess application in the background. How can I kill this

running process in background on hangs PHP page

北战南征 提交于 2019-12-12 05:41:11
问题 I have a PHP page that launches a python script, yet the PHP page hangs until the script finishes. Is there a way to run the script that will not make it hang? PHP code The problem occurs in case alarm_on. All other cases work fine. <?php session_start(); if(isset($_COOKIE['userME'])) echo "Hello, ".$_COOKIE['userME'].'<br>'; if(isset($_SESSION['UserData']['Username']) || $passed )// or $logins[$Username] == $Password) { if (isset($_POST['submit'])) { switch ($_POST['submit']) { case 'room

Preferred way to run custom animations

烂漫一生 提交于 2019-12-12 04:49:40
问题 I need to run a complex custom animation in an iOS app. For this, I wrote a function that needs to be called repeatedly and uses the current time-stamp to calculate positions, colors, shadows, etc. of UIView elements on the screen. There seem to be a whole bunch of different approaches I could use to have this function called: Multi-Threading Timers Dispatch Queues God knows what else... :) I tried calling my animation-function from a separate thread first, but while the thread does run, I

Background Notification ( [https://github.com/katzer/cordova-plugin-local-notifications]) in XDK (xdk cordova build “Android” does not build)

﹥>﹥吖頭↗ 提交于 2019-12-12 04:48:47
问题 Which Background notification plugin is available for xdk? I tried to build an app with the below plugin and The build failed. Error: Plugin "myBackgroundNotification" failed to install. What's wrong with XDK cordova build? Or what's wrong with the plugin and the id? The plugin-> [https://github.com/katzer/cordova-plugin-local-notifications.git] The plugin-ID->[de.appplant.cordova.plugin.local-notification ] from this link-> [https://github.com/katzer/cordova-plugin-local-notifications]

How to run a service in iOS background to receive local notification?

核能气质少年 提交于 2019-12-12 04:35:27
问题 I am working on app where there is an MQTT connection with the server and server is sending some values related to device and UI changes accordingly. But when app is in background user should get local notification that certain values are changed. I know background service are not allowed in iOS but I want to make sure that is that there is no way to achieve this. I successfully added local notification with app in background by UIApplication.shared.beginBackgroundTask but it's only work for

How to test background process in RSpec?

痴心易碎 提交于 2019-12-12 04:33:37
问题 Found this simple way to run a separate process in Sinatra: Run background process in Sinatra get '/start_process' @@pid = Process.spawn('external_command_to_run') end How would you test this in RSpec? Ruby 1.9.3. 回答1: Extract a class which does the background processing and unit-test it. Then test expectation that your action invokes method on this class Some "pseudocode": before do MyWorker.should_receive(:perform) end specify { get :something } 来源: https://stackoverflow.com/questions

PushKit: Can we use push kit(VoiP Push) in Chat Application without using VoiP

China☆狼群 提交于 2019-12-12 03:01:58
问题 I want to sync my local DB with server when Push notification came, but I am not able to do it with Silent Notification because application:didReceiveRemoteNotification:fetchCompletionHandler not called when app killed by user. So, I did not know how to do it, then I read about push kit but don't know is it possible to use push kit without VoiP feature. Please tell me is it possible or not?? If not, suggest me any other idea , how will I run background task when app killed by user?? 回答1: In