Reputation: 1467
I am a little unsure on how to store and load files on Android.
I know that Assets are stored in file:///android_assets/
, but this directory is exclusive to every application and read only, right?
Where can/ should I store files that are created on runtime and are exclusive to their app/ should be shared between apps?
Upvotes: 0
Views: 54
Reputation: 43738
Check out the documentation of the Context class. It has several methods that return directories where to put files depending on their nature (private, media, cache, ...).
Upvotes: 2
Reputation: 4297
In your Manifest file use -
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Then to access external storage use one of methods from the class Environment -
getExternalStorageDirectory()
getExternalStoragePublicDirectory(String type)
Upvotes: 2