background-process

Play audio from a Music Video using Youtube API in android, when my app is minimized

这一生的挚爱 提交于 2019-12-04 09:40:14
I am working on an app that uses the Youtube API. Since I'm concentrating mainly on MUSIC * VIDEOS * from Youtube, I need to play the audio of the video in the background when I navigate away from the app. But every time I navigate to another app, the video pauses. What can I do to get this issue fixed? Please help me. Thanks in advance From my understanding, the activity will pause when it goes to the background. Please refer to android activity life cycle. When the activity goes to pause state, the video and audio linked with it will pause. You will need a service to stream the audio in the

How do I start a background task from a VisualStudio post-build event?

大憨熊 提交于 2019-12-04 09:37:13
问题 I'm trying to start an instance of grunt watch whenever a particular project is run from VisualStudio. I have a single page-app written in ember, and compiled with grunt, which connects to a backend written with WebAPI. I'm trying to reduce friction so it's possible to Start Debugging (F5) in VS and have it get everything up and going. If I add a post-build event to compile the app with grunt, it works fine: node node_modules\grunt-cli\bin\grunt dev --no-color grunt watch never terminates, so

NetworkInfo is not properly responding to network changes on phone running Nougat

佐手、 提交于 2019-12-04 08:05:24
Preface: This is working just fine on a phone running 6.0.1. but on my phone that is running 7.1.1, it is not, as shown below. build.gradle (Module:app) compileSdkVersion 25 buildToolsVersion "25.0.0" applicationId "com.gesslar.threshvote" minSdkVersion 19 targetSdkVersion 25 AndroidManifest.xml <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <receiver android:name=".NetworkChangeReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.net.wifi.WIFI_STATE_CHANGED"/> <action android:name="android.net.conn.CONNECTIVITY

Make wpf UI responsive when button click is performed

为君一笑 提交于 2019-12-04 07:33:31
In my wpf (c#) application , a long process is performed when a button is pressed by the user. When button is pressed until the complete code executed the window freezes and user cannot perform any other task in the window. How can I make the button click code as a background process, so that the window become responsive to the user. I have tried the following method, but was unsuccessful. private void btn_convert_Click(object sender, RoutedEventArgs e) { Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { WorkerMethod(); })); } Where WorkerMethod is the

How to Run a Task in swift on a particular date-time in background either application is on or off

戏子无情 提交于 2019-12-04 07:32:14
I am working on alarm application, i need to schedule alarm on specific time, I use scheduleLocalNotification for scheduling alarms and it's working fine as i want. BUT I need to run to a request to my API server before triggering alarm. In that request I want to check some parameters returning from API server, If that satisfies some condition. If any one have a method that run on a particular date - time in swift Please help me for that func addAlarm (newAlarm: Alarm) { // Create persistent dictionary of data var alarmDictionary = NSUserDefaults.standardUserDefaults().dictionaryForKey(ALARMS

Run atexit() when python process is killed

泪湿孤枕 提交于 2019-12-04 06:09:08
I have a python process which runs in background, and I would like it to generate some output only when the script is terminated. def handle_exit(): print('\nAll files saved in ' + directory) generate_output() atexit.register(handle_exit) Calling raising a KeyboardInterupt exception and sys.exit() calls handle_exit() properly, but if I were to do kill {PID} from the terminal it terminates the script without calling handle_exit(). Is there a way to terminate the process that is running in the background, and still have it run handle_exit() before terminating? Try signal.signal . It allows to

iOS Detect Bluetooth connection/disconnection

谁说我不能喝 提交于 2019-12-04 04:28:03
Is it possible to be notified when a Bluetooth Device is connected or disconnected from iOS even when my app is in background ? On Android, I use the ACTION_ACL_CONNECTED and ACTION_ACL_DISCONNECTED events. But I cannot find equivalents for iOS. I found the CBCentralManager that can be used to monitor Bluetooth events, but my functions aren't called when a bluetooth device is connected/disconnected, only when I enable/disable the bluetooth. Is it an error on my side or is it normal ? I also found the doc about Audio Route changes, that can also be an idea to detect the bluetooth connections

Can the R console support background tasks or interrupts (event-handling)?

☆樱花仙子☆ 提交于 2019-12-04 04:16:20
While working in an R console, I'd like to set up a background task that monitors a particular connection and when an event occurs, another function (an alert) is executed. Alternatively, I can set things up so that an external function simply sends an alert to R, but this seems to be the same problem: it is necessary to set up a listener. I can do this in a dedicated process of R, but I don't know if this is feasible from within a console. Also, I'm not interested in interrupting R if it is calculating a function, but alerting or interrupting if the console is merely waiting on input. Here

Is there any system level background queue process in iPhone?

允我心安 提交于 2019-12-04 03:59:44
问题 I need to save a big file, sometime it takes a very long time to finish, user might just close the application. I am wondering whether the iPhone SDK could take over the unfinished big task. Appears iPhone's own mail system could do background send. I prepared a email, click send, then close the mail app immediately. In home page, after several seconds, I heard a sound and the email was delivered. 回答1: You're out of luck. Only Apple's own apps are allowed to operate in the background. But I

Programmatically check if a process is being run in the background

余生长醉 提交于 2019-12-04 03:33:53
问题 2 questions: 1) Is there any Linux/Posix API to know if a process has been invoked as a background process? linux> myprogram & Can the code for myprogram detect that it has been invoked to run in the background (via & ) ? 2) Is there any Linux/Posix API to make a process run in the background even if it has been started as a foreground process? I.E. somehow 'detach' from the shell at runtime.. (either detach itself from the shell completely, or run as a background process of the shell). linux