I'm in the final stages of WP8 app development and I'm looking ahead to submitting the app. However, I'm confused at how to to submit the files (images and text files) that are consistently being read from the Isolated Storage throughout my app. Currently in test/debug mode, when running the emulator I'm using the Windows Phone Power Tools to add these files to the Isolated Storage when I run the app for the first time and everything works great - files and images are read properly based on the directories I've set up in the Power Tools.
Obviously, when submitting the app there isn't a similar way of connecting the phone to the isolated storage. So my question is simple: how do you simply place the proper files/directories into the Isolated Storage to begin with when you submit your app for approval?
I've done some research and understand how to do this programmatically, but to do so it means that each of the files you intend to place in the Isolated Storage need to be a part of the content of the original app (in some folder that is a part of your project). So, why would anyone intentionally add their files to the isolated storage and then read the files back when needed, when they could just leave them inside the project folders and serve the same purpose? It seems like this is just extra work that doesn't need to happen to produce the same results. What am I missing?
At this point in time it's too late for me to revamp everything - each static image and text is read from a file stored on the Isolated Storage, but I'm wondering why I did that in the first place?
Most importantly, do I need to code every image and *.txt file and place it in the Isolated Storage or is there an easier way to upload the files ONCE and they'll remain in Isolated Storage on the user's WP8 after the app is installed?
Some info about Content files (static files)
If you have static files - that is, files that do not change once the app is deployed except on update of the app - you put these files in the app as Content. You add them in VS and set their "Build Action" to "Content" (from the "Properties" of the files). In most cases the Build Action will be set by default, though.
Then to read these files you use:
Application.GetResourceStream(uri);
Some info about Isolated Storage files (dynamic files)
If you need files that you'll be changing based on user actions (files for settings, scores, some other user data), you have to create these programmatically and put them in Isolated Storage. You cannot add files to Isolated Storage in any other way than programmatically. Putting the static files there is just not the way to do it, hence there is no way to (except manually copying them from app's Content).
To read these files you use the IsolatedStorageFile API, like this:
using (var isoStore = IsolatedStorageFile.GetUserStoreForApplication()) {
// read/write IsoStorage files using the methods on the isoStore object
}
Recommendation to the OP
I would recommend that you just change your app to work with Content files where it needs to. This couldn't take you more than a day, and it would be the right way to do it. You could copy the files from Content, but I do not recommend that, unless you really really need it. I could give ideas if that's the case, though.