BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-02-2007, 10:51 AM   #1
raghav_kamath
New Member
 
Join Date: Aug 2007
Model: 7100v
PIN: N/A
Carrier: Airtel
Posts: 2
Default SMS protocol problem

Please Login to Remove!

Hi everyone.
I am new to BlackBerry Development. I want to send SMS from my application. I have used BlackBerry DatagramConnection API's and It is working fine, whenever there is GPRS connection. I want to do the same without GPRS connection as normal SMS technology works.

Plz Can anyone help me in this issue?

Thanks in Advance.

Raghav
Offline  
Old 08-02-2007, 10:59 AM   #2
pa4o85
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Default

Well my decision for the problem is...

Code:
MessageConnection conn = null;
      TextMessage text = null;
      try {
        conn = (MessageConnection) Connector.open("sms://");
        conn.close();
        text = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
        text.setPayloadText("message");
      } catch (IOException e) {
        Dialog.alert("Exception: " + e);
      }
      Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(text));
With this code the system sms application for sending SMSs is opened and the body is "message" and you should choose the number you want and SEND it
Offline  
Old 08-03-2007, 04:01 AM   #3
raghav_kamath
New Member
 
Join Date: Aug 2007
Model: 7100v
PIN: N/A
Carrier: Airtel
Posts: 2
Default SMS invoke problem

Hi,
Thanks for the reply. It worked fine but i need to send sms, without any interfearence. I have an static message to send and this process should be automated without invoking system SMS application.
Thanks in Advance.
with regards,
Raghav.
Offline  
Old 11-13-2007, 06:29 AM   #4
jeyaprakash.c
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: chennai.india
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 57
Arrow Error while sending

hi pa4o85

i use your sample code but my application shown this error
"Error Starting Sendsms MOdule "SendSms"attempts to accessa secure Api"
how to solve this type of errors is my application need signing?
Offline  
Old 11-13-2007, 08:06 AM   #5
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Default

the correct code to send a sms directly is as follows,
number is a string with the phone number of the target device,
msg a string with the message you want to send.

Code:
MessageConnection _dc = (MessageConnection)Connector.open("sms://"+number);                 
Message sms = _dc.newMessage(MessageConnection.TEXT_MESSAGE);
TextMessage sms2 = (TextMessage)sms;
sms2.setPayloadText(msg);    
_dc.send(sms2);
this is using a secure api, you need to sign your code using the $100 signing key.
be sure to use this inside an own thread.

@pa4o85: your code is a bit strange. you open a connection just to close it in the next line... and why would you want to create a message manually when you invoke the sms-application anyhow?

hth,
simon
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 11-15-2007, 02:35 AM   #6
jeyaprakash.c
Thumbs Must Hurt
 
Join Date: Oct 2007
Location: chennai.india
Model: 8100
PIN: N/A
Carrier: airtel
Posts: 57
Arrow Sms Protocal Problem

hi pa4o85 thanks for your reply

i fix my problem i already added that No string but i didnt sign my application thats why my Application asking permission .... i want to create a message connection for device boot up time my application want to start automatically in every bootup how to Autostart my sms application is? i use Jde Autostart Properties but it wont work is it need Signing ?
Offline  
Old 05-13-2008, 11:31 PM   #7
airan
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: Airtel
Posts: 20
Default

I was able to send the message without gprs also using Datagram connection.

But the message reaching the recipient is junk ..I think it is going as binary or some part of UDH is getting messed up.
This is the code i use .
Code:
	DatagramConnection dc = 
				(DatagramConnection)Connector.open("sms://"
						               +message.GetDestAddress());
			
       Datagram d = dc.newDatagram(dc.getMaximumLength());
			
	d.setData(msgText[i].getBytes(), 0, msgText[i].length());
        dc.send(d);
Can anyone throw some more light on it .??
__________________
Thanks
Amit

Last edited by airan; 05-13-2008 at 11:39 PM..
Offline  
Closed Thread



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


Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030 picture

Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030

$28.88



BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$37.96



Shark RV761_N Robotic Vacuum Cleaner With Charging Dock Navy Blue Black Tested picture

Shark RV761_N Robotic Vacuum Cleaner With Charging Dock Navy Blue Black Tested

$38.00



Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW picture

Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW

$35.00



3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit picture

3 CFM Air Vacuum Pump HVAC Manifold Gauge Set AC A/C Refrigeration Kit

$47.55



Commercial Vacuum Sealer Machine Chamber Food Saver Bag Packing Sealing 110V picture

Commercial Vacuum Sealer Machine Chamber Food Saver Bag Packing Sealing 110V

$239.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.