Serial Port and Palm(MIDP)

hi all,I need to read some data from a palm serial port. Is anybody know how I can do this?Thanks a lotfdonia
[144 byte] By [fdonia] at [2007-9-26 11:35:21]
«« buttton
»» JFrame
# 1

[fdonia],

For MIDP 1.0, there is no specific APIs for the runtime environment to access the serial port of the Palm OS devices. And currently, I am not sure if Palm Inc has provided any propriertary API extensions to their MIDP implementation that allows access to the serial port. Can I assume that you are using the MIDP for Palm OS 1.0 java runtime environment on your Palm OS device?

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Yes, I use the MIDP for Palm OS 1.0. There is a package in C++ who work correctly but I don't know if there is possible to use native code with my palm?Thanks for your helpfdonia
fdonia at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

[fdonia],

As far as developing native Palm OS applications is concerned, the Palm OS website has a very comprehensive page that describes the best practices and tools for C/C++ application programming for the Palm OS platform:

http://www.palmos.com/dev/c.html

Just to summarise - for MIDP 1.0 for Palm OS, this MIDP implementation does not contain any API that allows a MIDlet programmer to control the serial port of the Palm device as it is not required by the CLDC/MIDP specification.

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
http://www.wabasoft.com/
macgibbon at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

Hi,

I am very interested in using serial port in palm.^^

I have found a solution in

http://forum.java.sun.com/thread.jsp?forum=50&thread=90727

However, I need 2 files to get the KVM.prc , KVMutil.prc and CLDC API

1.j2me_cldc-1_0-src-winsol.zip

2. j2me_cldc-1_0-src-palm_overlay.zip

They are said to be in Sun but I can find the first file only.

watashiha at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6

I have found the KVM.prc, KVMutil.prc Then, I tried to code a programlike this:

import java.io.*;

import javax.microedition.io.*;

import com.sun.kjava.*;

class CommTest extends Spotlet

{

OutputConnection oc=null;

OutputStream dataOut=null;

String strURL="comm:0";

public static void main(String[] args)

{

(new CommTest()).register(NO_EVENT_OPTIONS);

}

public CommTest()

{

try

{

oc=(OutputConnection) Connector.open(strURL);

oc.close();

}

catch (Exception e)

{

System.err.println("Send data exception " + e);

}

}

}

I tried to run this program, however, I got this: Send data exception javax.microedtion.io.ConnectionNotFoundException: The required protocol does not exist comm:0

How can I solve this problem?

watashiha at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
I have gotten that error when all communications parameters have not been supplied. The following code works for me:sc = (StreamConnection)Connector.open("comm:0;baudrate=9600;bitsperchar=8;stopbits=1;parity=none",Connector.READ); Thom
tcohn at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8

tchon,

I've read in your message that you got a code working ok with palm ports.

I have a problem, and I woluld like to get your opinion, becouse I can't make it work.

I have developed a code to open serial port in palm, becouse I need to print from palm.

I can't open any port.

What i get is a code like this:

String ports = System.getProperty("microedition.commports");

This line, when running in a topdesk with j2me toolkit, shows me:

ports 0,1

That means I have com1 and com2 recognized.

In the palm, I get

ports

That means, there is no comm port available in the palm.

I tryed your code

sc = (StreamConnection)Connector.open("comm:0;baudrate=9600;bitsperchar=8;stopbits=1;parity=none",Connector.READ);

I can't open the port.

I tryed with palm 100 and palm 130.

I need to use serial cable to send characters to a printer.

I saw a program printing invoices with palm 100. I don't have the source code. I would like to do it using java.

Any way, a code in c would be nice, becouse I need to solve this problem. My preference is java.

Is there any configuration that has to be made in the palm? I mean Connection or Network preferences.

Thanks for your kindness.

Regards,

Luis Inserra

Luis_Inserra at 2007-7-2 1:38:08 > top of Java-index,Java Mobility Forums,Java ME Technologies...