Skip to Main Content

Embedded Technologies

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sending SMS on Win Mobile 5.0

843849Mar 3 2008
Hi !

I am relatively new to J2Me and would like some help on sending SMS using a PDA. I have been trying to create a program (using WMA) which should enable me to send an sms via my PDA (O2 Zinc). Although there are no errors to the program, it simply refuse to send the SMS out.

A portion of the codes is found below:

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
try {
String addr = "sms://+6598292837";
jLabel1.setText("address added");
{color:#ff0000} MessageConnection conn = (MessageConnection) Connector.open(addr);{color}
jLabel2.setText("message connection set");
TextMessage msg =
(TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
jLabel3.setText("text message set");
msg.setPayloadText("Hello World!");
jLabel4.setText("text set");
conn.send(msg);
}catch (Exception e){e.printStackTrace();}
}

I added in the jLabel text change to see which are the lines being executed. And it was found that the codes after {color:#ff0000}
MessageConnection conn = (MessageConnection) Connector.open(addr); {color:#000000}was never executed.

I must apologise i kinda s.u.c.k in using exception but i try to add this in and it caught the connection not found exception.

public void sendTxtMsg() throws IOException{
try{ ......
} catch (ConnectionNotFoundException ex) {ex.printStackTrace();jLabel3.setText("error: "+ex);}
}


have i missed out on any steps? or should i use a different approach to the problem?


Your help is very much appreciated! Thanks for all the help
Desperate Programmer.

{color}{color}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2008
Added on Mar 3 2008
0 comments
106 views