File dir = Environment.getExternalStorageDirectory();
if (dir.exists() && dir.isDirectory()) {
String exStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath();
File appPath = new File(exStoragePath + "/mbrc/");
appPath.mkdirs();
String tempFilename = "tmp.wav";
String tempDestFile = appPath.getAbsolutePath() + "/" + tempFilename;
return tempDestFile;
}
I try this on HTC with Android 2.2 but directory is not created and file also not. If i try this on SAMSUNG S2 wuth android 4 then works.
Why this not working on HTC and android 2.2?
You need to create the file.
http://docs.oracle.com/javase/7/docs/api/java/io/File.html#createNewFile()