Topic
  • 1 reply
  • Latest Post - ‏2008-02-21T16:38:15Z by SystemAdmin
SystemAdmin
SystemAdmin
9394 Posts

Pinned topic Installing and using JSR-75 problem

‏2008-02-17T16:52:37Z |
Hi all,

I am a newbie for J2ME with these problems:

I am using handheld with Windows Mobile 2003 Second Edition and J9 5.7.2. I have downloaded j2me_pda_fc-1_0-fr-spec.zip, extracted it and copied files
fileconn.dll to \Program Files\J9\MIDP20\bin on device, and
fileconn.jar to \Program Files\J9\MIDP20\lib\jclMidp20\ext

I tried this Midlet:

  • - -
import java.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.io.file.*;

public class MyTest extends MIDlet {

private String filename = "test.txt";
private String folder = "//";
private Alert A;

public MyTest() {

try {
FileConnection FC = (FileConnection)Connector.open("file://"+folder+filename);
} catch (Exception e) {
A = new Alert("Error!", "Exception: " + e.getMessage(), null, AlertType.ERROR);
A.setTimeout(Alert.FOREVER);
Display.getDisplay(this).setCurrent(A);
return;
}
A = new Alert("Info", "Test (done)", null, AlertType.INFO);
A.setTimeout(Alert.FOREVER);
Display.getDisplay(this).setCurrent(A);
}

public void startApp() {}
public void pauseApp() {}
public void destroyApp(boolean cond) {}
}
  • - -

On emulator WTK it works ok, but on handheld when i launch it, it doesn't run. It only blinks and returns to main page of "Midlet HQ". I have even tried to rename fileconn.jar to fc.jar (because of some web pages) and the same thing happened.

Could you please tell me what I am doing wrong. And also, what should I wrote to variable folder if I want to read files from SD card or CF card? "/SDCard/" and "/CFCard/"?

Thanks in advance, I am realy desperate :(

Regards,
Borut
Updated on 2008-02-21T16:38:15Z at 2008-02-21T16:38:15Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Installing and using JSR-75 problem

    ‏2008-02-21T16:38:15Z  
    Example of file URL that works for me is

    file:///Storage%20Card/my_folder/readme.txt

    I'm using pdap_fc package mentioned in this blogpost: http://www.markus.brosch.net/?p=111
    Updated on 2008-02-21T16:38:15Z at 2008-02-21T16:38:15Z by SystemAdmin