views:

91

answers:

1

Hi everyone,

In the app I am making, I would like to take a Base64 image that is received from a server, and save it to a file for displaying later. My question is where should I store this file? It needs to be dynamic, and may be empty when the program launches. I am unsure how exactly the file system on Android works, such as how file paths look.

Ideally I would like to be able to write the data to the image file using a FileOutputStream, and then display that image somehow.

Thanks!

A: 

you should follow the standards defined on the Android Data Storage docs. This will give you information on how to save to internal storage, external storage (sdcard for example), and to a database.

Since you are "caching" the file, you would save it to the selected storage (internal/external) to /Android/data/<package_name>/cache/. You would probably only want to use internal storage if external storage was not available, in my opinion.

Ryan Conrad