Message sending failed by jsr 205_2.0 wireless messaging API
Hello ,
I m triing to send message by using jsr 205_2.0 wireless messaging API on Nokia c2-03 but it fails to send
My code:
public string sendMessage(data, mobno)
{
String smsPort="16050";
String address = "sms://+"+"mobno" + ":" + smsPort;
String msg=data;
MessageConnection smsconn = null;
try
{
smsconn = (MessageConnection) Connector.open (address);
TextMessage txtmessage =
(TextMessage) smsconn.newMessage (MessageConnection.TEXT_MESSAGE);
txtmessage.setAddress (address);
txtmessage.setPayloadText (msg);
smsconn.send (txtmessage);
}
catch (Throwable t) {
System.out.println ("Send caught: ");
t.printStackTrace ();
return "FAILED";
}
return "SUCESS";
}
Is there any problem with port no.
I hav tried port no 5000 as well but not working ..
Thank u
Re: Message sending failed by jsr 205_2.0 wireless messaging API
Hi amol_list,
See other [url=http://www.developer.nokia.com/Community/Discussion/showthread.php?215308-sending-message-using-j2me#post801780]discussion thread [/url] on the same issue.
[QUOTE]You have to send the message to a specific port that an app on the receiving side is waiting for. J2ME doesn't allow you to get to regulard inbox messages (port 0).[/QUOTE]
see [url=http://www.developer.nokia.com/Community/Wiki/Listening_asynchronously_for_incoming_SMS_messages_in_Java_ME]Listening asynchronously for incoming SMS messages in Java ME [/url]
and
[url=http://www.developer.nokia.com/Community/Wiki/How_to_send_a_text_message_to_a_given_port_as_SMS_with_Java_ME]How to send a message to a given port as SMS with Java ME [/url]