background-process

Doing background stuff on a different UI

和自甴很熟 提交于 2019-12-25 18:12:51
问题 I have designed an app that gets the network information and updates the UI every 5 seconds. It is advised to do the background processes on a separate thread than the UI thread, and I did so...but I still get an error that: "I/Choreographer﹕ Skipped 3730 frames! The application may be doing too much work on its main thread." Why is that? Here's my code protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); wifiTextView

Doing background stuff on a different UI

一曲冷凌霜 提交于 2019-12-25 18:12:17
问题 I have designed an app that gets the network information and updates the UI every 5 seconds. It is advised to do the background processes on a separate thread than the UI thread, and I did so...but I still get an error that: "I/Choreographer﹕ Skipped 3730 frames! The application may be doing too much work on its main thread." Why is that? Here's my code protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); wifiTextView

Background location update every n minutes

梦想的初衷 提交于 2019-12-25 09:26:32
问题 I'm writing an application that requires location updates every n minutes and sends data to a server even when the application is in background mode. I have gone through so many links about this task. As I found the proper solution is to use a timer and make it as a background task. Concerning to this I have two questions: How can I implement these regular background location updates? I understand that Apple allows background tasks for an only certain time. So how can I make long-running

Periodic sending small data to server in background mode

本小妞迷上赌 提交于 2019-12-25 06:44:13
问题 I am implementing a kind of tracking app and i need to spot my location once and send it once per 10 - 20 seconds (period value is important and can't be exceeded). To lower battery consumption i stop location updates. This works good in foreground, but how can i do it when app moved in background? I looked info about background fetch, but it hasn't got precise time for periodic sending data How can i perform this task? 回答1: You can start and Stop periodic location update while app is in

Background Task works on Simulator only

﹥>﹥吖頭↗ 提交于 2019-12-25 05:29:07
问题 Background I have created a sample timer app that counts from a specific value down to zero. A label displays how much time is left. Every time the NSTimer (1s interval) calls countDownSecs() it prints how many seconds are left and executes println("countDownSecs()") . When the countdown has reached 0 seconds it sends a local push notification. When running in the simulator that works and even for like 5 minutes it stays in the background and continuously prints the seconds left and

android start activity from background thread

孤街醉人 提交于 2019-12-25 04:51:50
问题 My app creates a timer task (background thread) and periodically need to display something. Main screen maybe hidden later by other apps. I found out (AFAIRemember on stackoverflow) that for making toast notification I need to use runOnUiThread runnable (just Toast.makeText crashed the app). Now I want my background thread to be able to collect user input. I created activity class with layout and call it via intent Intent intent = new Intent(this, screen2.class); startActivityForResult(intent

android start activity from background thread

僤鯓⒐⒋嵵緔 提交于 2019-12-25 04:51:07
问题 My app creates a timer task (background thread) and periodically need to display something. Main screen maybe hidden later by other apps. I found out (AFAIRemember on stackoverflow) that for making toast notification I need to use runOnUiThread runnable (just Toast.makeText crashed the app). Now I want my background thread to be able to collect user input. I created activity class with layout and call it via intent Intent intent = new Intent(this, screen2.class); startActivityForResult(intent

Run background task from MainScreen in BlackBerry?

≡放荡痞女 提交于 2019-12-25 04:04:29
问题 The issue is how do i make an inception in BlackBerry? Background: I need to run background service (No Screen Application) after i register a client, after that i need to run safely on the thread. Thank you very much in advance , code example will be really appreciated. 回答1: You'll need to create a runnable class that extends thread. (Note, there may be other ways to do this, but this one works. So you'll need something like public class BackgroundTask extends Thread{ private Object _screen;

How to do some task in background after kill the application

放肆的年华 提交于 2019-12-25 03:15:11
问题 i am doing one application.In that one task is running in background every time.My problem is,if i kill the application then that task also stopped.But i want to run that task after application killed by user.How to do this one. 回答1: There is no way to run any kind of processes in the background after user kills the application. See what Viber does for their app. So you can give a notice to user not to quit the app, but you would have to give them a valid reason. And if your app is not GPS or

Is it possible to use NSFileManager's `copyItemAtURL:toURL:error:` method when the app is in the background?

青春壹個敷衍的年華 提交于 2019-12-25 02:55:17
问题 I'm working on an iOS app, uploading videos from the Camera Roll, using NSURLSession with a background configuration. The user can queue up multiple videos for upload (the queue is executed serially). A single upload consists of: Getting an AVURLAsset reference to the PHAsset using PHImageManager's requestAVAssetForVideo method. Copying the resource to a temp directory (because you cannot upload straight from the AVURLAsset's URL). Uploading the resource using an NSURLSessionUploadTask I can