Hi abdul.wahab,
This might be code related or software related. After some testing on Nokia 303 with software version 14.60, I was able to display on the screen a file that contained this String: "Some info يتس in Arabic" with this code:
Code:
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class FileReadTextMIDlet extends MIDlet {
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
Form mainForm = new Form("Arabic File Read");
Display.getDisplay(this).setCurrent(mainForm);
try {
String filepath = System.getProperty("fileconn.dir.memorycard") + "testapp/test.txt";
FileConnection fconn = (FileConnection)Connector.open(filepath);
InputStream is = fconn.openInputStream();
int size = is.available();
InputStreamReader isr = new InputStreamReader(is, "UTF8");
char[] data = new char[size];
isr.read(data);
String output = new String(data);
mainForm.append(output);
is.close();
fconn.close();
}
catch (IOException ioe) {
System.out.println(ioe.getMessage());
}
}
}
The text file should be placed in the memory card, under the path testapp/text.txt. Could you try again with this code? It might be that you need to update your device's software.