background-process

iOS background fetch time limit crash

怎甘沉沦 提交于 2019-12-21 20:54:51
问题 I've set up background fetch, using outline from NSScreencast episode #92. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum]; ... } - (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { if ([[MyAppAPIClient manager] reachable] && [[Session manager]

CodenameOne background task for BluetoothLe connection

99封情书 提交于 2019-12-21 20:51:28
问题 I am developing an app using Codename One, which connects to a Bluetooth LE proprietary external device and logs received data (on average data arrives approximately once per second). I am using the Bluetooth LE CN1 library (a wrapper for Cordova Plugin). The app should be able to receive and log the data even when not in foreground, which I have no idea how to do in CodenameOne in a way that the system wont shut it down on its own. I've written a native Android app, where I use a service

Detecting reboot programmatically in Windows Phone 8.1

徘徊边缘 提交于 2019-12-21 17:39:07
问题 I have a WP 8.1 Runtime which launches a DeviceUseTrigger background task. The problem is that whenever the phone reboots, this task obviously cancels, but the task registration remains in place. So when I launch my app the next time the background task appears to be running when in reality it isn't. I want some way of detecting whenever the phone reboots and/or detect in some way whether or not the task is actually running or not. The code I'm using to check background task registration is

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

徘徊边缘 提交于 2019-12-21 17:27:45
问题 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 回答1: 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

How to use background task using Swift 3?

徘徊边缘 提交于 2019-12-21 12:18:52
问题 I am new in background tasks. I have a small work that I am fetching tweets and If my app is in background mode then also it should fetch tweets, but I don't know how. I am using simply Timer in Appdelegate didFinishLaunchOption Method. When I will close the app then it's not working. I am new in that so please any suggestion. Here below is my code: Timer.scheduledTimer(timeInterval: 10, target: self, selector: #selector(getTweets), userInfo: nil, repeats: true). func getTweets() { let

iOS 4 VOIP app responding in the background

≡放荡痞女 提交于 2019-12-20 10:55:55
问题 I have an iPhone VOIP app that copes with multi-multi transmit and receive (ie teleconferencing) set up using BSD sockets. I would like it to be able to respond to incoming requests when it is in the background but from what I can understand of the iOS 4 docs I can only do this on an NSStream object (or CFRead/WriteStream) by setting the property to NSStreamNetworkServiceTypeVoIP. This is a bit of a problem as my system is a UDP BSD sockets based application. Everything is received and sent

iOS 7 Background Fetch When the App is Not Running

这一生的挚爱 提交于 2019-12-20 09:44:59
问题 I've written a simple application in order to test and monitor how the background fetch feature works in iOS7. First of all, I've set UIBackgroundMode options in my Info.plist file. Then; I added to below code into application:didFinishLaunchingWithOptions: method in AppDelegate.m : At last, I've implemented the application:(UIApplication *)application performFetchWithCompletionHandler: method as requested. Every time I click Debug->Simulate Background Fetch button, it changes the application

Best way to send HTTP GET requests ansynchronously in Android?

老子叫甜甜 提交于 2019-12-20 08:45:08
问题 In an Android app, I have to make multiple GET requests to a URL in order to transmit data to an external server (that's how the third party API works). Data comes in sporadically. I store this data in a queue and want to send it to the server in a background asynchronously without slowing down the main UI thread. Each unit of data in the queue requires a GET request. The queue has to be emptied even if the app closes. What's the best practice to do this? Please post/direct me to code

Having a NSTimer running background

北城余情 提交于 2019-12-20 07:52:47
问题 I've seen hundreds of solutions of how to get a NSTimer to run in the background. I know that it is possible, just look at apps like Strava and Runkepper that tracks your time when working out. But what is the best practice solution for doing so? I can't find one unison solution for this. Also, I would like the NSTimer to be used across different UIViewControllers. How is this done as a best practice? Thanks in regards! :) 回答1: NSTimers don't run in the background. Store the current time and

Background Thread to Call Methods

て烟熏妆下的殇ゞ 提交于 2019-12-20 06:10:10
问题 I've found this method to work with background thread. My question is that I've run a whole process in background thread which include number of methods. Frist method calls the second one and the the second one makes some data and pass it to the third one. -(void)firstMethod dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ if(someCondition == 0) { [self secondMethod:myArray]; } } dispatch_async(dispatch_get_main_queue(), ^(void){ [self