01-18-2010 05:17 AM
Totally agree, this question has come up here a few times.
A few possible solutions:
1. This thread I posted a solution to this problem - http://supportforums.blackberry.com/t5/Java-Develo
2. The Search button above would help.
3. There is a KB with an example.
4. There is an example in the API docs as well.
Please search before posting, there are numerous resources on this.
Give kudos if somebody helps you, also mark accepted if it solves your problem. Search first, then post. Please respect RFC-1855 when posting on forums.
01-19-2010 11:32 PM
Thank you for the post.
My requirement is sending SMS automatically to other phone without user intervention. Hence I don't want to use default application to be invoked that comes with Blackberry.
I have tested the SMS code using WMA way and RIM API way as explained at http://myhowto.org/java/j2me/22-sending-and-receiv
Also some discussions at
The code is working fine when I have tested on 8700 series. But for 8330 it is throwing exception (at customer end). Unfortunately I don't have 8330 to test.
After further investigation on google, what I understand is people were discussing on CDMA and GSM enabled SMS features. Also they are asking to to use DatagramConnection instance instead of MessageConnection instance. Tried all the ways based on the various KBs and internet discussions. But no luck. :-(
Here are the different ways
mc=(MessageConnection) Connector .open("sms://" + phone);
TextMessage m = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE, "//" + phone);
m.setAddress("sms://" + phone);
smsConnection = (DatagramConnection) Connector.open("sms://:0");
SmsAddress destinationAddr = new SmsAddress("//" + phone);
Datagram d = smsConnection.newDatagram(completePayload.length);
d.setData(completePayload, 0, completePayload.length);
tried below methods also
smsConnection = (DatagramConnection) Connector.open("sms://"+phone+":0");
smsConnection = (DatagramConnection) Connector.open("sms://"+phone");
So I am really not sure what will be causing issue for sending SMS using 8330 mobile.
Can you please help me on how to resolve this issue?