hi, i need to write one application that in nokia 6630 read on filesystem for images, while in 6600 read into jar
(6630 has FileConnection and PIM API)
If i use this code, my apps doenst starts in 6600 while in 6630 works well:
public void run() {
try
{
if (System.getProperty("microedition.io.file.FileConnection.version" )!=null) {
String link = "file:///Memory Card/00003OUT.png";
FileConnection fc = (FileConnection) Connector.open(link);
if (fc.exists()){
InputStream is = fc.openInputStream();
Image image = Image.createImage(is);
is.close();
frmImage.append(image);
}
fc.close();
} else
{
try {
Image im = Image.createImage("/00003IN.PNG");
frmImage.append(im);
} catch (IOException e) {
frmImage.append(e.toString());
}
}
}catch (Exception e){
frmImage.append("file: "+link+"exx: "+e);
}
}
In the code above, if i delete line
"FileConnection fc = (FileConnection) Connector.open(link);"
the app runs on 6600.
the problem is the cast "(FileConnection)"
if i do:
"FileConnection fc = null;"
"Connection cn = Connector.open(link);"
the app works again in 6600..
but i need the same app work in 6600 and 6630
is possible?
Thanks
Matteo

Reply With Quote

