my application works good in default gray phone(midp2,cldc1.1)
same application is not working in default colour phone(midp2,cldc1.1)
here is the code
pls help...........thx in advc.............
public void myaxe() throws IOException
/////function
{
fc = (FileConnection)Connector.open("file:///root1/myfile.txt",Connector.READ_WRITE);
//fc.create();
InputStream is = fc.openInputStream();
int i = 0;
while((i = is.read())!=-1)
{
char s = (char)i;
System.out.println("================================= "+s);
//i++;
}
fc.close();
is.close();
}
==================================
public void startApp() {
try {
myaxe();
//////////fuction call
} catch (IOException ex) {
ex.printStackTrace();
}
if (midletPaused) {
resumeMIDlet ();
} else {
initialize ();
startMIDlet ();
}
midletPaused = false;
}
============================================
public void commandAction(Command command, Displayable displayable) {
// write pre-action user code here
if (displayable == form) {
if (command == backCommand) {
// write pre-action user code here
exitMIDlet();
// write post-action user code here
} else if (command == okCommand) {
// write pre-action user code here
System.out.println("=============================== before call======================");
Thread t = new Thread()
{
public void run()
{
try
{
myaxe();
///////second call
}
catch (Exception e)
{
e.printStackTrace();
}
}
};
t.start();
// write post-action user code here
}
}
===============================================
here are the errors i got
error on first call
=====================================
java.io.IOException:
at com.sun.midp.io.j2me.file.Protocol.openInputStream(Protocol.java:183)
at com.sun.midp.io.j2me.file.Protocol.openInputStream(+9)
at fileconn.myaxe(fileconn.java:230)
at fileconn.startApp(fileconn.java:198)
at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
error on sec call
==============================================
java.io.IOException:
at com.sun.midp.io.j2me.file.Protocol.openInputStream(Protocol.java:183)
at com.sun.midp.io.j2me.file.Protocol.openInputStream(+9)
at fileconn.myaxe(fileconn.java:230)
at fileconn$1.run(fileconn.java:109)
pls help its very urgent ...........thx once again.........

Reply With Quote




