Saving image resources at runtime


I’m working on an online/offline app that syncs a small number of images from a large available pool of server images while online and later needs to load them from disk when the phone has no internet connectivity.

Is there a way to save an image during an apps runtime that can later be used as a resource via the method described here? I’m not sure if the resource directory is accessible to save files to.

Again, I don’t want to embed the image before I distribute the app, I want the user to be able to download and save to disk from a large pool of images at runtime. I realize I can save the images to the documents folder and pull them from disk using imageResource instead, but in that case I run into out of memory errors which I’ve not been able to solve using garbage collection.