3

I want to save image from a url in assets folder. I can save image in internal memory or sd card but I want to save in the assets folder.

I searched about it online but some results are saying that the assets folder is not writable. Is it possible to write image in that folder?

Ivaylo Slavov
  • 8,839
  • 12
  • 65
  • 108
Saifuddin Sarker
  • 853
  • 3
  • 8
  • 26
  • "some saying its assets folder is not writable" some ? not all ? ... it's not possible period – Selvin Jan 09 '12 at 12:38
  • No its not possible to write anything or save anything in the resources. – Lalit Poptani Jan 09 '12 at 12:38
  • i found here http://stackoverflow.com/questions/8381261/how-to-save-back-into-a-file-in-assets-folder about it. that saying that.. but i saw in some places that assets folder is readable. i mean we can show image from assets. so just need to know more about assets folder is it writable or not? – Saifuddin Sarker Jan 09 '12 at 12:42

2 Answers2

3

No, you can't. But why do you need it to save it in there? if you want it to be store in the private area of your application (so your application is the only with access to it), you can do it, but if you want an image to be in your assets folder, you need to place it in there before you compile to create the apk.

Data Storage - Internal Memory

P.S. I don't recommend you to save large images on internal storage as this space is very limited in legacy devices.

SERPRO
  • 10,015
  • 8
  • 46
  • 63
  • Could you please explain how to do="if you want it to be store in the private area of your application (so your application is the only with access to it), you can do it" – ridvanzoro Nov 20 '13 at 14:00
  • 2
    @ridvanzoro `FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);`http://developer.android.com/guide/topics/data/data-storage.html#filesInternal – SERPRO Nov 20 '13 at 14:45
1

it is not possible , Here same topic discussed check it

StackOverflow

Community
  • 1
  • 1
Parag Chauhan
  • 35,760
  • 13
  • 86
  • 95