All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

  #1  
Old 09-03-2011, 02:28 PM
mamech mamech is offline
Registered User
 
Join Date: Feb 2011
Posts: 2
mamech is on a distinguished road
Serial communication problem

Hello

I used the following code to open serial port on nokia N70 mobile

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.microedition.io.CommConnection;
import javax.microedition.io.Connector;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;

/**
* @author mostafa
*/
public class Serializer extends MIDlet {
Connector con;
OutputStream os = null;
CommConnection cc = null;
InputStream is = null;
Alert alert;
int i=0;

public void startApp() {

try {
cc = (CommConnection) Connector.open("comm:com0;baudrate=19200");
i=1;
//int baudrate = cc.getBaudRate();


is = cc.openInputStream();
i=2;


os = cc.openOutputStream();
i=3;
int ch = 0;
while(ch!=10)
os.write('k');
i=4;
cc.close();
i=5;
os.close();
i=6;
}
catch (Exception ex) {
String s= ex.getMessage();
alert = new Alert("Problem");
alert.setString(s+""+"i="+i);
alert.setTimeout(alert.FOREVER);
Display.getDisplay(this).setCurrent(alert);

}

}
public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}
}


And the output on the mobile screen was:
java.lang.ClassNotFoundException: com/symbian/midp/io/protocol/comm/Protocol
i=1
(which means it throwed the exception during this command: cc = (CommConnection) Connector.open("comm:com0;baudrate=19200")

Can any one tell me what is wrong?
Ads
 

Bookmarks

Tags
communication, problem, serial

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[N95 8GB] Problem with Nokia Maps mubde3 Nokia N95 and N95 8GB 2 11-01-2008 05:10 PM
One hell of a problem jkeysers Nokia N80 13 20-10-2006 09:12 AM
N-Gage QD problem m0uth Nokia N-Gage and N-Gage QD 5 07-06-2005 09:25 PM
7650 Display problem NotBillGates Nokia 7650 1 02-10-2004 05:08 PM
Serial port connection problem with PC adelinesun81 Sony Ericsson P800, P900 and P910 0 18-09-2004 08:36 AM



All times are GMT. The time now is 01:38 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy