Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
New Developer
Posts: 1
Registered: ‎03-09-2009
My Device: Not Specified

Basic SMS send failing (GSM to GSM, using SMSdemo code)

Hey, Im pulling my hair out here trying to get basic SMS code to work, and I must be missing something. Im using a T-Mobile Curve 8900 and Im developing a simple app to programmatically send SMS (no special listener on the other end - simply send a plain text message). Here's the code (copied from SMSdemo)

 

MessageConnection mc; try { mc = (MessageConnection)Connector.open("sms://:3590"); if(mc==null) throw new IOException(); TextMessage m = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE , "//" + mAddress + ":3590"); m.setPayloadText(mMsg); mc.send(m); mc.close(); }

It doesnt throw any exceptions, it just simply...doesnt send. Nothing in the Curve's outbox, nothing on the receiver phone. I've tried different phone number formats for constructing the address (15551234567, 5551234567, +15551234567) but none work. This is sending to/from a GSM network. Any clues? Do I need a different port, and if so which?

 

Also, for the issue of including CDMA, whats the proper way to handle this? I can use MessageConnection for GSM-GSM (well, in theory), and Datagram for CDMA-CDMA and CDMA-GSM, but what about GSM-CDMA?

 

Thanks for any help you can provide!

 

 

New Developer
Posts: 21
Registered: ‎03-09-2009
My Device: Not Specified

Re: Basic SMS send failing (GSM to GSM, using SMSdemo code)

Check out this link
New Developer
Posts: 12
Registered: ‎06-09-2009
My Device: Not Specified

Re: Basic SMS send failing (GSM to GSM, using SMSdemo code)

Hi !

 

I think your problem is with using ports.  you need to use port 0.

this port is the port which remote application is listening.

if you are sending sms to other phone, and you want to see  in its inbox, use port zero.

 

if you want to send on specific port - you need to use DatagramConnection and you need set UDH field to true.  follow this link:

 

http://myhowto.org/java/j2me/22-sending-and-receiving-gsm-sms-on-blackberry-using-rim-apis/

 

it describes how you can correctly form and send binary sms using DatagramConnection.

 

regards,

Alibek