0

I am writing an app that continuously scans for all access points that are in range and saves log to a text file. The scanning should start when user clicks the "Start" button and run until "Stop" button is clicked even if user switched to other app.

As I understand, this functionality can be achieved using the background task but I keep getting exception telling "Not enough quota is available to process this command. (Exception from HRESULT: 0x80070718)", when trying to register a background task.

Any ideas, what might be wrong?

Full code: https://www.dropbox.com/sh/1v9mbr3xhgr3283/AACDbB7skZUI7Z5fiu0HT8r4a?dl=0

1 Answer 1

1

Are you registering the background task every time your app runs? Are you checking to see if it is already registered? It's possible to register your background task multiple times and, as only so many background tasks registrations are allowed (depending on device) then you may have run out of capacity. Check this page which provides the following quote:

It's important to check this because if a task is registered multiple times, it will run more than once whenever it’s triggered; this can use excess CPU and may cause unexpected behavior.

1
  • Damn, I had the check, but I didn't formulate the if clause correctly! Thank you very much! Commented Nov 13, 2016 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.