Serial port connection supporting in MIDP

Hi,

We are working on a project, in which a Java application is developed and running on MIDP4Palm. It needs to read in GPS data from the serial port of Palm VII, but we got an error message of "unsupported protocol: comm.". Part of the source code is as follows:

InputConnection ic= (InputConnection)

Connector.open("comm:1;baudrate=9600");

DataInputStream dis= (DataInputStream)ic.openInputStream();

If you happen to know about something serial port connection supporting in MIDP or some extended Java class files pertaining to this, it would be highly appreciated that you could drop a line or two on it or some suggestions on where to find such stuff. Thanks a lot!

WJ.

[725 byte] By [wenjiesun] at [2007-9-26 5:55:15]
# 1

[wenjiesun],

I hope that you are aware CLDC/MIDP 1.0 profile specifies that only HTTP is supported as the connection protocol. Hence your line:

Connector.open("comm:1;baudrate=9600");

,is giving you the exception error message of "unsupported protocol: comm".

Take a look at this thread discussion if you wish to use an unsupported way of communicating over the seial I/O of the Palm:

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

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

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

allenlai at 2007-7-1 14:27:15 > top of Java-index,Java Mobility Forums,Java ME Technologies...