The problem is that in the first start of my app i load some images from the drawable folder and then put them into my storage using this function:
1- I first make them as bitmap
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.autobus);
and then I convert them using this function
private String saveToInternalSorage(Bitmap bitmapImage, String imagename) throws IOException{
ContextWrapper cw = new ContextWrapper(getApplicationContext());
// path to /data/data/yourapp/app_data/imageDir
File directory = cw.getDir("imageDir", Context.MODE_PRIVATE);
// Create imageDir
File mypath=new File(directory,imagename);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(mypath);
// Use the compress method on the BitMap object to write image to the OutputStream
bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, fos);
} catch (Exception e) {
e.printStackTrace();
} finally {
fos.close();
}
return directory.getAbsolutePath();
}
But now I need to do the same for a sound , I need to store the sound fields in the raw section in the internal memory in order to use them later .
So if some one can help me that would be gentle of him , PS: I store the path to those files in my SQLite data base.