Search code examples
scheduled-taskswindows-phone-8background-processisolatedstoragelive-tile

Is there a shared file location for foreground and background tasks?


I need to communicate a value between my foreground and background projects/tasks. Is there a shared/common folder where I could store values both can access? Or is it possible to pass an arg from the foreground task to the background task as it starts up? Or (what would be the easiest solution), do they both read/write from/to the same IsolatedStorage area? I doubt that, but perhaps when the foreground app references the background app, that commonality is made available?

Similarly, I want to update the badge on the foreground app's live tile; can I do this directly from the background task, or will I need to find a workaround, such as writing to a commonly accessible file, and then the foreground task periodically checks that file for update info?


Solution

  • The IsolatedStorageFile class can be used both in normal application and background task, also it works fine both in WP7 and WP8 apps. How to use it is described here:
    All about WP7 Isolated Storage - Read and Save Images
    Also updating live tiles can be done both from normal application and background task, you don't have to use any workarounds.