I want to create a file on device and read that file,I had written the code
but,I don't know where I went wrong.
I had used the following code: To creat file
To read the file
FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/testfile.txt");
// If no exception is thrown, then the URI is valid, but the file may or may not exist.
fconn.create(); // create the file if it doesn't exist
FileOutputStream fileOutputStream = new FileOutputStream(1,"file:///SDCard/testfile.txttestfile.txt");
String str="welcome to funnyworld";
byte data=str.getBytes() ;
String datafromServer= data.toString();
int length = datafromServer.length();
fileOutputStream.write(data, 0, length);
FileInputStream fileInputStream=new FileInputStream(1,"file:///SDCard/testfile.txt") ;
can anyone suggest me the proper solution
I got another Question
Can we see the created file on the device?