0

Is is it possible to save downloaded images from my site into the drawable folder? I've preloaded the images, but how can I save them for later use?

Thanks!

Bart Wesselink
  • 286
  • 6
  • 16

2 Answers2

2

You can't save anything into the drawable folder. What is packaged at compile time is all it'll have.

Instead, you can save the images to the external storage, or into a database or into internal storage.

Community
  • 1
  • 1
Raghav Sood
  • 81,899
  • 22
  • 187
  • 195
  • And how can I delete them when the app closes? – Bart Wesselink Oct 24 '12 at 16:42
  • If you want to delete them when the app closes just keep them in the memory, which will be released when your app is killed. If you are running into memory problems, or want to store them across runs, use persistent storage. As for deleting from persistent storage, just delete those rows from the database, or use standard Java IO to delete the files from disk. – Raghav Sood Oct 24 '12 at 16:45
1

No, because there's no "drawable" folder at all. All your drawables remain in APK file after installation and your APK file is read only hence no modification of any sort is possible. Use SD card or application storage for storing files.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141