I want to export a file to SDCARD, i have however this log message:
04-11 18:34:22.383: DEBUG/Carburant(5734): /mnt/sdcard/Carburant/alaa.peugeot.settings.dat (Is a directory)
I want to have alaa.peugeot.settings.dat
not as a directory, but as a file.
Here is my code:
try{
final SharedPreferences preferences = PreferenceManager
.getDefaultSharedPreferences(context);
String fileName = context.getResources().getString(R.string.fileName);
String fileDir = "" + preferences.getString("login", "") + "."+ preferences.getString("marque", "") + ".";
File dir = new File (sdCard.getAbsolutePath() + "/Ca开发者_如何学Gorburant");
dir.mkdirs();
File file = new File(dir, fileDir+fileName);
OutputStream out = new FileOutputStream(file);
File f1 = new File(context.getFilesDir(), fileDir+fileName);
InputStream in = new FileInputStream(f1);
What going on with the code? Thank you very much.
精彩评论