Try this code.
File oText = new File("/sdcard/test.txt");
try{
FileOutputStream fStream = new FileOutputStream(oText);
fStream.write("xxx".getBytes());
fStream.close();
}catch(Exception e){
e.printStackTrace();
}
This will be write file to SD card on emulator. and you can check by
using command 'adb shell'
2009/8/17 Dany BREARD <[email protected]>:
>
> Hi I want to create new File into android or in my workspace but a
> FileNotFoundException is thrown.
>
> [syntax="java"]
>
> byte[] decoded = Base64.decode( StringBase64 );
>
> File oText = new File("C:/Documents and Settings/.../workspace/
> SocketInterface", "File");
> //or: File oText = new File( "File");
> //FileNotFoundException
>
>
> FileOutputStream fStream = new FileOutputStream(oText);
> fStream.write(decoded);
> fStream.close();
>
> [/syntax]
>
> How can I create my File ??
> Maybe there is something to instantiate about android security or
> something other ???
>
> Thanks in advance.
> Dany
> >
>
--
Panut Sunyakorn
086-334-1616
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---