multitasking

UILocalNotification repeat sound

▼魔方 西西 提交于 2019-12-13 11:35:17
问题 I have used the code from apples example from this page: Link, but I can't seem to get the sound to repeat. I have checked other applications, such as skype (for VOIP) and Alarm Clock Pro (audio?) but I cannot get the sound file to be repeated. This is my code: - (void)applicationDidEnterBackground:(UIApplication *)application { AlarmHandler *AHinstance = getAlarmHandlerInstance(); UIApplication* app = [UIApplication sharedApplication]; NSArray *alarmList = [AHinstance getAlarms]; NSArray

Enabling and disabling multitasking within application

Deadly 提交于 2019-12-13 04:29:54
问题 Currently, my iPad application implements multitasking. However, I would like to offer the user an option to disable multitasking. Is this possible, given the fact that you cannot modify the Info.plist dictionary where the UIApplicationExistsOnSuspend key is set? 回答1: Well, you could set a flag in your application delegate that would simply exit your app when the flag is TRUE within the delegate method applicationDidEnterBackground: , like this: @interface MyAppDelegate : NSObject

Python double FOR loops without threading

自古美人都是妖i 提交于 2019-12-13 04:23:58
问题 Basically, I want to make a grid with school subjects and all the test results I got from it, and I want to display about 10 results for every subject. Like this: ... -------------------------------------------------------------------- English| 7.4 | 6.4 | 9.5 | 4.5 | 8.9 | 3.9 | 8.0 | 6.5 | 9.9 | 4.9 | -------------------------------------------------------------------- Dutch | Results ... And I made basically two FOR loops, one reading every school subject out of a list and one that reads

Is Application.DoEvents() a form of Multitasking?

穿精又带淫゛_ 提交于 2019-12-13 03:05:43
问题 I am pretty sure Applicataion.DoEvents() in Windows Forms. is a very early, very primitive, WindowsForms only form of Multitasking. It has all the telltales and mechanics: Pausing execution of the calling Event. Making the rest of said Event a continuation to be run later. Allowing the other Events/Processes to run. Just with some extra issues, because the MT is implemented via the EventQueue. Possibly even a recursive call to the Queue. But I just ran into a person that insists it has

iPhone Task Completion

北城余情 提交于 2019-12-12 10:53:14
问题 I started a few days ago to experiment development for the iPhone platform, and while reading about it's multi-tasking capabilities I found out the "task completion", which can be very useful. I googled a little, read the documentation available at developer.apple.com/iphone, but still haven't found something: is there a way to have this task completion run a loop (possibly an infinite one), or a timer which would run like every 10 minutes? I know it's like "cheating" and they probably have

Use of Standard location service for tracking traveled distance in a foreground/background app

淺唱寂寞╮ 提交于 2019-12-12 09:02:16
问题 I have to develop a kind of GPS navigation application that needs to constantly keep track of the position of the user, which is moving by car. In the specific, I don't have to display the current location on a map but just to record its position with the best possible precision in order to calculate the total distance traveled. Of course the application needs to continue its work in background if the user switch to another app, a phone call come in or something like that… From the tests I

Android foreground service lose context

北城以北 提交于 2019-12-12 03:45:33
问题 I have a little problem understanding what's going on with a service lifecycle that I created. My Application declare and use a service "LocalisationSevice" which its goal is to start a location listener and add the updated location to an array. Simple as that. The service run foreground. The problem is that if I manually kill my application though the task switcher or eclipse the service will stay (GPS and notification are here in the notification area). Thats fine, it is what I want, if I

Wake app at regular intervals while using UIBackgroundModes=location

ⅰ亾dé卋堺 提交于 2019-12-12 03:22:52
问题 I'm developing a navigation app which uses the UIBackgroundModes=location setting and receives CLLocationManager updates via didUpdateToLocation . That works fine. The problem is that the intervals between location updates are very hard to predict and I need to make sure the app is called something like once every few seconds to do some other (tiny) amounts of work even if the location did not change significantly. Can I do that? Am I allowed to do that? And how can I do that? I found a blog

stackoverflow exception on multitasking console app

99封情书 提交于 2019-12-12 03:19:10
问题 I have a probram which runs some long algorithim, so I work it in many tasks. while Job methods working in tasks I have another method which checking if all tasks done or if some still working. but JobChecker method gave me stackoverflow exception. why It gives error and how can I fix this? public void Main() { while ((line = sr.ReadLine()) != null) { string lineTemp = line; taskList.Add(Task.Run(() => Job(lineTemp, last))); } JobChecker(taskList); } public void JobChecker(List<Task> taskList

Cancel child tasks when one of them throws an exception

て烟熏妆下的殇ゞ 提交于 2019-12-12 02:26:45
问题 I'd like to improve the following code to add cancellation support. Basically, what I need to do is cancel all children as well as the parent task once a child throws an exception. I wrote the below code as a learning experience. I can see AggregateException only after all children finish, but I don't want that. static int GetSum() { var parent = Task<int>.Factory.StartNew(() => { var children = new Task<int>[100]; for (var i = 0; i < children.Length; i++) { var index = i; children[index] =