Here is the code that creates he file in SDCARD, in fact it's a copyfile
function:
InputStream in = new FileInputStream(f2);
OutputStream out = new FileOutputStream(file);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) != -1){
out.write(buf, 0, len);
}
//out.flush();
in.close();
out.close();
Toast.makeText(context, "Export effectué", Toast.LENGTH_SHORT).show();
}
catch(FileNotFoundException ex){
Toast.makeText(context, "File Not found", Toast.LENGTH_SHORT).show();
String x=ex.getMessage();
Log.d("Carburant", x);
}
catch(IOException e){
Toast.makeText(context, "Echec", Toast.LENGTH_SHORT).show();
Log.d("IOException", e.getMessage());
}
}
Thanks TerKing :).
2011/4/12 TreKing <[email protected]>
> On Tue, Apr 12, 2011 at 6:44 AM, Alaeddine Ghribi <
> [email protected]> wrote:
>
>> Perhaps the code to creating the file in sdcard is wrong :\ ! Is it ?
>
>
> I don't know. Honestly, I got bored of reading the giant blob of
> unformatted code. Which (small) part creates the file on the SD card?
>
>
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en