I want to install files in my application's documents directory when installing the app, and the app needs to be able to download a new version of these files if needed.
At the moment, I am packaging these files in res/raw and copying them locally. That's a waste of space since the device will contain both the resource and the local copy. Is there a mechanism that would let me bundle the file directly to a writable directory rather than in the resources?
Here is what I am doing at the moment:
File moviesDir = cw.getDir("movies", Context.MODE_PRIVATE);
in = getResources().openRawResource(R.raw.tutorial);
file = new File(moviesDir,"tutorial.mp4");
copyInputStreamToFile(in,file);