This discussion is archived
0 Replies Latest reply: Nov 26, 2010 10:53 PM by 819081 RSS

Setting path in Midlet application

819081 Newbie
Currently Being Moderated
Sear All,

I'm new to Midlet programming, I tried to create an application which checks if a file exists or not, it works perfect when I use the simulator, but when U send the JAR file to the mobile it always display a msg that the file does not exist!!

The code is as follow:
try {

Connector.openDataOutputStream("file:///C:/J2ME.jpg");
if (fCon.exists()){
append("Found\n");
}
else {
append("Not Found\n");
}
}
catch(Exception e){
System.out.println("Error");
System.out.print("Error: " + e.getMessage());
}


When I try this it works, but when I change the path to

file:///SDCard/J2ME.jpg

to be used on mobile I get always Not found msg....



Help please,,


Greetings

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points