0

Is there a way to prevent the screen from getting locked while the app the running(basically while downloading) ??

Use of ApplicationIdleDetectionMode lets the app be running when the screen gets locked but on screen lock also wi-fi gets disconnected which is essential for the app to be running !!

Bhavana K
  • 23
  • 5
  • What does your app do that requires WiFi access whilst not in use? could you use a background upload/download agent instead? – Rowland Shaw Apr 18 '12 at 10:40

2 Answers2

1

You might be able to use PhoneApplicationService.UserIdleDetectionMode :-

http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.phoneapplicationservice.useridledetectionmode(v=vs.92).aspx

For additional information the following thread may help :-

http://social.msdn.microsoft.com/Forums/is/windowsphone7series/thread/c38d897f-afb6-48ab-a2d0-57ebbb632dae

Paul Diston
  • 3,279
  • 1
  • 17
  • 20
1

Instead of preventing the phone going to the lock-screen you should better use the new (7.1) BackgroundTransfer-Agent. There are a few restrictions (maximum of 5MB upload, files larger than 20MB require WiFi instead of mobile-data, files larger than 100MB require the phone to be connected to a external power source), but is the recommend method for uploading / downloading larger files with Windows Phone. Also your app doesn't have to be running in foreground when using this service.

More information:

Anheledir
  • 4,337
  • 7
  • 32
  • 34