In WP8, if we set
ApplicationIdleDetectionMode = IdleDetectionMode.Disabled
the app continues to run even when the screen is locked.
If, for instance, we have a WebBrowser in an app (which is actually active only when the app is in the foreground), and the above property is set as disabled:
Will the WebBrowser continue its execution even when the screen is locked (for example, playing an audio file).
Will the WebBrowser continue its execution even when the app is switched to the background.
Thanks.
As for running under lock screen - yes it should run, you can get more information from MSDN.
As I have tested once, WebBrowser is using BackgroundAudio to play (audio element), so it should also play under lock screen and probably in background (thought you should test it).
When the App goes to dormant state - all its processes are stopped MSDN:
When the user navigates forward, away from an app, after the Deactivated event is raised, the operating system will attempt to put the app into a dormant state. In this state, all of the application’s threads are stopped and no processing takes place, but the application remains intact in memory.
You should also watch out for Certification requirements, when usind AppIdleDetection - point 6.3 – Apps running under a locked screen.
Related
I've been dealing with a fault found during testing that I can't seem to get to the bottom of. I have a Windows 8.1 application running on a laptop on Windows 10. The user was using the application, left the laptop for a couple of hours, when they came back the application had disappeared and had lost the data that hadn't yet been saved. This has happened twice on the same machine.
Digging through the Event Viewer on the machine, it appears the following scenario happened:
Application was started
Device went into suspend
Device resumed
During the resume process, the following event appeared in the Event Log:
Package XXX+App was terminated because it took too long to suspend.
Running through the suspend mode using the Visual Studio tools it seems to take around 300ms to run the code that saves the current state.
I don't understand why the application would be suspending while the device itself was resuming. Could this be a case of the app suspend started before the device suspended, and when the device resumed it decided it'd had long enough? In which case what is the correct way to handle this?
Or is this something completely different? I'm not certain where to go with this and can't seem to find any documentation that covers the app suspend/resume in conjunction with a device suspend/resume.
Thanks
I'm using the AS3 Timer class to sync data between a Flex Mobile app and a server ideally every 30 mins then send a local (distriqt) Notification to the user when action is required.
However, when the device goes into sleep / hibernate mode it seems to slow down, even stop the Timer. I've tried using a lower interval (5mins) but it still only works intermittently.
This is very hard to test as the behavior is different in debug / run modes.
Any suggestions?
Thanks.
Sounds like you might need to change your approach here. Background operation of applications is very different from the foreground.
Your application will run for a little while (depending on the current device memory load among other things) and will then enter a suspended mode, mainly to preserve the application's memory state.
There are some background mode exceptions to this, such as audio playback and location updates, however if you aren't performing these then Apple will most likely reject your application as part of the review process.
You can also investigate the executeInBackground flag on the NativeApplication. This allows a long running task to execute in the background, however this does not guarantee that the application would run in the background continuously.
You can read more here: http://blogs.adobe.com/airodynamics/2012/05/04/air-ios-background-behavior/
UIBackgroundModes: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW22
When a user first opens my app, I need to download and install some content from a server before they can begin using the app. The problem is that this takes around 5 minutes on wifi, during which time the app goes into the background and the download is suspended.
Is there any way to either:
Prevent an windows app from entering the background while I perform my download
or continue peforming the task in the background (i.e. perform the task irrespective of whether the app is in the foreground or background)
Also, I don't want to use the BackgroundDownloadManager
Thanks
When the app is being suspended, all processes are stopped and and background task cancelled. Your last chance to do something is Suspending event - see more at MSDN.
In your case, when you need to download big file in the background - the mentioned BackgroundDownloader would be the best option - it's designed for such tasks. In other cases you will have to convince user to leave the app in the foreground (a message?), also take care about lockscreen (see DisplayRequest class).
I'm not also sure but maybe you will be able to use BackgroundTask (separate process), triggered with MaintanceTrigger - but then user will be able to download the file only in specific circumstances and probably not right away.
What does event OnSuspending in App.xaml.cs mean? I suppose this event is fired when we change Metro to Desktop or change metro application but what is done with app memory? Is it freed, saved somewhere or it is kept until OS exhausted memory? What steps I have to do as a programmer to keep application working after resuming? What do I need to save?
From your applications point of view, the suspend is somewhat like the 'pause' option of the debugger. Execution is completely stopped and the OS has the option to either resume the app at a later point or shut it down for good.
In the first scenario, your app will not have a clue about the meantime. In case it is shut down by the OS, on the next start the previous execution state will be set to 'terminated' so you should restore the app as it was when you received the 'suspend' event.
I have a web application with three states.
Dial in — (basically, none of the below)
VOIP — Connected to a Freeswitch instance
Listen — this option is through a normal connection to an FMS instance (different server from #2).
The initial state is chosen via a pop-up when the user first enters the application. From then on, these are all controlled by a ComboBox. When it changes, the application checks for all open connections and then closes them. It then opens the appropriate new connection.
The problem is that sometimes this causes the application to freeze for 10-20 seconds, and sometimes it causes it to crash and I have no idea why. traces which should fire before the VOIP change only appear after the freeze (there will be a delay in the timestamps), but if I comment out the call to the change function, they appear in the order expected.
What is going on? Is this architecture simply not tenable? Is there a better way to do things?
Apparently... the connections were a red herring.
After looking at the results on the server, it became apparent that the problem was with placing the call to the processing functions inside of a Flex generated EventListener. The previous developer used the change="handler(event)" property which was causing the crash. When I switched over to <voip-drop-box>.addEventListener("change",function(e:Event):void{});, everything cleared up instantly.