I’m using Eclipse 3.7.0 to build my Android app. I saw the post that tells me that to access a file in external storage, I should create a path of the form Environment.getExternalStorageDirectory() + "/Android/data/" + getPackageName() + "/subfolder/myfile.xml". I also saw the post that tells me to check for the availability of the SD Card before continuing. All of that seems to make sense to me.
When the app is first installed, I’d like to set up the directory subfolder and place the file myfile.xml into that directory. How do I tell Eclipse to do that? I’ve created the file, but where do I place them on the Package Explorer? I tried in the root and in the assets directories, but neither of those seem to work.
Where are files that are placed into assets stored?
For working with the assets, the AssetManager is the thing to use:
http://developer.android.com/reference/android/content/res/AssetManager.html
But this is totally different from working with the SD card. Files in the assets folder can be provided by yourself on compile time. The SD card is something you can’t access during compile time but during runtime.