
|
Creating a serial port connection using Java This article describes how to make the CommConnection on Sony Ericsson's UIQ 3 phones. Refer to the Java ME Developers' Guidelines for how this can be done on non-Symbian OS phones>> For this example to work, the USB drivers must be installed on the PC. They are included in the PC Suite which is available for download here>> Now connect the USB cable to the UIQ 3-based phone and start the HyperTerminal. Start >> Programs >> accessories >> accessibility >> HyperTerminal or Start >> Run "hypertrm" The HyperTerminal must be connected to the Debug Port. Check the Device Manager for the correct port number. Control Panel >> System >> Hardware >> Device Manager >> Ports Now it's time to start the MIDlet on the phone. The MIDlet can be started before the PC makes the connection to the phone. To check if serial connection is supported, the Class.forName(…) method can be used. Class.forName("javax.microedition.io.CommConnection"); To check which com ports are available for the MIDlet, the system property "microedition.commports" can be used. System.getProperty("microedition.commports")); Make sure to use the USB3 port for the connection. And to make the connection between the phone and the PC, we can use the code: try{ InputStream is = conn.openInputStream(); }catch(Exception e){ More information: |
Copyright © 2001 - 2009 Sony Ericsson Mobile Communications AB. All Rights Reserved.