|
| Installing and using JSR-75 problem |
 |
Sun, 17 Feb 2008 11:52:37 EST |
Hi all,<br />
<br />
I am a newbie for J2ME with these problems:<br />
<br />
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<br
/>
fileconn.dll to \Program Files\J9\MIDP20\bin on device, and<br />
fileconn.jar to \Program Files\J9\MIDP20\lib\jclMidp20\ext<br />
<br />
I tried this Midlet:<br />
<br />
<ul class="jive-dash">
<li>- - </li>
</ul>
import java.io.*;<br />
import javax.microedition.lcdui.*;<br />
import javax.microedition.midlet.*;<br />
import javax.microedition.io.*;<br />
import javax.microedition.io.file.*;<br />
<br />
public class MyTest extends MIDlet {<br />
<br />
private String filename = "test.txt";<br />
private String folder = "//";<br />
private Alert A;<br />
<br />
public MyTest() {<br />
<br />
try {<br />
FileConnection FC =
(FileConnection)Connector.open("file://"+folder+filename);<br
/>
} catch (Exception e) {<br />
A = new Alert("Error!", "Exception: " +
e.getMessage(), null, AlertType.ERROR);<br />
A.setTimeout(Alert.FOREVER);<br />
Display.getDisplay(this).setCurrent(A);<br />
return;<br />
}<br />
A = new Alert("Info", "Test (done)", null,
AlertType.INFO);<br />
A.setTimeout(Alert.FOREVER);<br />
Display.getDisplay(this).setCurrent(A);<br />
}<br />
<br />
public void startApp() {}<br />
public void pauseApp() {}<br />
public void destroyApp(boolean cond) {}<br />
}<br />
<ul class="jive-dash">
<li>- -</li>
</ul>
<br />
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.<br />
<br />
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/"?<br />
<br />
Thanks in advance, I am realy desperate :(<br />
<br />
Regards,<br />
|
| Post Reply
|
| Re: Installing and using JSR-75 problem |
 |
Thu, 21 Feb 2008 11:35:01 EST |
Example of file URL that works for me is<br />
<br />
|
| Post Reply
|
|
|
|
|
|
|
|
|
|