0

I'm creating an app which has various default icons. These are stored in the 'drawables' folder, as png files. I want to be able to copy these across to internal storage when the user installs the app. I have the names of the drawables stored in the database (see my question from yesterday, here).

I'm not sure how to actually read the drawable in as a file, though. So, let's say I have a drawable called 'icon.png'. I need to open that and copy it across to the internal storage - but I'm not sure what the file path should be or how to go about it. I've been going round in circles in the documentation and got myself really confused!

Can anyone point me in the right direction?

halfer
  • 19,824
  • 17
  • 99
  • 186
Sharon
  • 3,471
  • 13
  • 60
  • 93
  • 1
    Have you read this? https://developer.android.com/training/basics/data-storage/files.html And you have a lot of questions in SO talking how about convert a drawable to a file, one of them: http://stackoverflow.com/questions/10174399/how-can-i-write-a-drawable-resource-to-a-file – Alberto Méndez Jun 03 '16 at 16:21
  • Thank you, that looks like exactly what I need! – Sharon Jun 03 '16 at 16:54

0 Answers0