GetUrisAsync when screen is locked.

Oct 16, 2014 at 6:41 PM
Maybe it was asked before but is there a way to get the method to work when the screen is locked and the system is in battery safe mode? because when ever the method is called in such a state an exception is thrown and the app close immediatly.

Thank you in advance
Coordinator
Oct 16, 2014 at 7:05 PM
This must be another problem, the method should always work. Whats the exception?
Oct 16, 2014 at 7:51 PM
I wish i could catch the exception and if i'm not mistaken is "ACCESS DENIED". It only happens on my tablet while testing some code... i noticed that the test app suddendly exits. I was trying to do the same using my VaioTab 20 but i can't get it to reproduce in debug modus so i haven't seen the exception yet as it never happen if visual studio is active. As said the app suddently exits even if i try-catch is over the code in order to get exception logged.
Oct 19, 2014 at 8:10 PM
Edited Oct 19, 2014 at 8:29 PM
Nobody knows the issue? been wondering because is holding me back right now in my tests. The exception is thrown because when the battery safe state kicks in the HttpClient code doesn't have access to the internet and hence why it exits. The funny part is that if my tablet stays on all the time there is no issue at all. It's also very easy to reproduce by following this steps:
  1. Setup the energy saving settings to 1 minute on battery mode
  2. Lock the tablet or just wait a minute until the screen turns black.
  3. Have a code that access the method on that state.
Hope someone can help me out because i haven't found a solution to the problem still and i'm out of ideas. I've tried all that came to my mind so far without success.
Coordinator
Oct 19, 2014 at 8:48 PM
This seems not related to the youtube classes but the underlying HttpClient classes. Maybe you should ask a question on stackoverflow.com with a sample to reproduce it with the HttpClient classes...
Oct 19, 2014 at 9:42 PM
That sounds like a good idea... i was thinking on the same but thought that maybe someone here had that issue before. Thank you anyways ;)