I have a requirement to create a text file on specified folder and write the data in it
i try this but it doesn't work :
file = new File(FileStorage.getPrivateDir(), "data");
if (!file.exists()) {
file.mkdirs();
}else{
fw=new FileOutputStream(file);
TextLabel sh=(TextLabel)findView(Res.id.ShFile);
Person person;
for(int i=0;i<persons.size();i++){
person=(Person) persons.elementAt(i);
sh.setText(person.getName()+" "+person.getNumberPhone());
fw.write(Res.id.ShFile); //public void write (int b)
}
Is there any example which will help me?