How to send SMS

Put your problem here if it does not fit any of the other categories.

How to send SMS

Postby Pushpa.Prakruthi » Wed Jan 16, 2008 12:52 pm

Hi ,

SMSReceiver code is working, its realy good ,but the thing is the msg can be send through emulator control can be notify.
If i want to send SMS how could i do that and how SMSReceiver will receive msg which is send by my application.
Pushpa.Prakruthi
Freshman
Freshman
 
Posts: 3
Joined: Wed Jan 09, 2008 9:38 am
Location: India,Bangalore

Top

Postby plusminus » Wed Jan 16, 2008 6:18 pm

Hello Pushpa.Prakruthi,

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         SmsManager sm = SmsManager.getDefault();
  2.  
  3.  
  4.  
  5.         sm.sendTextMessage(destinationAddress, null, "Hello world", null, null, null);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

Where I placed null, you can also put Intents to be fired on specific points in the lifetime of the SMS(like delivered/failed/...).
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         void    sendTextMessage(String destinationAddress, String scAddress, String text, Intent sentIntent, Intent deliveryIntent, Intent failedIntent)
  2.  
  3.         Send a text based SMS.
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


I hope I could help you.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby ksp » Tue Mar 11, 2008 12:26 pm

What value should be given to the destination address field?
ksp
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:50 pm

Postby plusminus » Tue Mar 11, 2008 3:04 pm

Probably the phone number ...?

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby ksp » Wed Mar 12, 2008 9:54 am

where will that SMS gets stored in the emulator if i want to check whether it has been received or not in the other end?
ksp
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:50 pm

Postby jchang1 » Tue Mar 18, 2008 6:34 pm

Hello plusminus,

You mentioned that you can specify Intents to be fired on specific points in the lifetime of the SMS (such as delivered, failed, etc) -- do you know if this means those Intents would be fired on the sender's phone, or on the receiver's phone?

In other words, if I call SmsManager.sendTextMessage() from my local emulator, would those Intents be fired on my local emulator, it would they (theoretically) be firing on the phone which received the SMS?

Along those lines, and especially if the answer is the latter, do you know if there is any way to emulate those Intents? I know you can emulate incoming SMS messages to your emulator from the Telnet command line ("sms send 15551234567 hello there"), but that obviously only emulates the text of the message itself, and not any of the associated Intents (the ones that were included in the SmsManager.sendTextMessage() call).


Thanks very much,
Jeff
jchang1
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Feb 27, 2008 9:18 am

Top

Postby Astrlz » Tue Dec 16, 2008 8:27 am

Hello Plusminus

"sendTextMessage" is used to send text message to another emulator port but is there any way to send sms to specific application port on another emulator.

i found "sendDataMessage" is used to send sms on specific application port but failed to use it successfully.
i also set permissions in manifest but once again failed. I dont know where i am wrong.

Actually i want to develop an application that receives the sms send on the specific port. those sms should not go to inbox. i found no way "how to send sms on specific port" and "how to register my application to specific port".

plz help me if u know any way. Thanks in advance.

Regards

Astrlz


jchang1 wrote:Hello plusminus,

You mentioned that you can specify Intents to be fired on specific points in the lifetime of the SMS (such as delivered, failed, etc) -- do you know if this means those Intents would be fired on the sender's phone, or on the receiver's phone?

In other words, if I call SmsManager.sendTextMessage() from my local emulator, would those Intents be fired on my local emulator, it would they (theoretically) be firing on the phone which received the SMS?

Along those lines, and especially if the answer is the latter, do you know if there is any way to emulate those Intents? I know you can emulate incoming SMS messages to your emulator from the Telnet command line ("sms send 15551234567 hello there"), but that obviously only emulates the text of the message itself, and not any of the associated Intents (the ones that were included in the SmsManager.sendTextMessage() call).


Thanks very much,
Jeff
Astrlz
Freshman
Freshman
 
Posts: 4
Joined: Fri Dec 12, 2008 8:57 am

Postby manish » Mon Mar 30, 2009 12:48 pm

plusminus wrote:Hello Pushpa.Prakruthi,

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         SmsManager sm = SmsManager.getDefault();
  2.  
  3.         sm.sendTextMessage(destinationAddress, null, "Hello world", null, null, null);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4

Where I placed null, you can also put Intents to be fired on specific points in the lifetime of the SMS(like delivered/failed/...).
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         void    sendTextMessage(String destinationAddress, String scAddress, String text, Intent sentIntent, Intent deliveryIntent, Intent failedIntent)
  2.         Send a text based SMS.
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


I hope I could help you.

Regards,
plusminus


Hi,
I Think this API is used to send messages from one instance of the emulator to another. Will it also work on the real phone to send SMS?
manish
Junior Developer
Junior Developer
 
Posts: 21
Joined: Thu Feb 05, 2009 1:06 pm

Postby Ventrix » Sun Apr 05, 2009 6:24 pm

how can I save a SMS that sent from the API to the inbox?
http://www.androidgreece.gr - Greek Android Community
User avatar
Ventrix
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Mar 04, 2008 11:47 pm
Location: Greece

port directed sms messages

Postby redcbr600 » Tue Jul 28, 2009 1:33 pm

Hi,

Has anybody been able to answer Astrlz question?

i.e. Get a working version of an app sending and receiving port directed sms messages from one device to the other? I have found sending and receiving text messages with sendTextMessage very straightforward and plusminus has a great tutorial on this. However, I have not had much luck using sendDataMessage.

The main benefit of sending sms's using sendDataMessage is that the sms is not supposed to hit the receiver's inbox.
redcbr600
Freshman
Freshman
 
Posts: 2
Joined: Wed Jul 08, 2009 6:58 pm

How to send MMS

Postby sumeet_3885 » Wed Jul 29, 2009 7:20 am

hi all ,
i send and Rx sms successfully by my own application now i want to make another application to send MMS and Rx MMS so can any body him me out hoew i start?

thax in advance

sumit (':wink:')
sumeet_3885
Freshman
Freshman
 
Posts: 4
Joined: Fri Mar 20, 2009 2:16 pm
Location: bangalore

Re: How to send MMS

Postby ramraj.mgv » Tue Sep 29, 2009 5:59 pm

sumeet_3885 wrote:hi all ,
i send and Rx sms successfully by my own application now i want to make another application to send MMS and Rx MMS so can any body him me out hoew i start?

thax in advance

sumit (':wink:')




HI,

I am trying to add Password to the message (in the Header that was provided by Android )
in GetsubmitPDU(,,,,Header[])

On the reciever side the message is not getting recieved

and it throwing a mResultcode error No service from SmsManager.java

Please let me know whether ISms.aidl in Android handles the extra header mechanism

Ramraj
ramraj.mgv
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Sep 29, 2009 5:40 pm

Postby Nemat » Fri Jan 29, 2010 12:30 pm

Hi,

I am trying to send sms on device.but my sms is sent twice.Here is my code:

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(destination,null, "This is test message",null, null);
Nemat
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Thu Aug 21, 2008 3:16 pm
Location: Jaipur

Postby mijalko » Wed Feb 17, 2010 8:03 pm

Hi Nemat,

I have the same problem (message is sent twice).

Did you found solution?
mijalko
Freshman
Freshman
 
Posts: 2
Joined: Wed Feb 17, 2010 8:00 pm

Postby nithin_in » Fri Feb 19, 2010 11:47 am

mijalko wrote:Hi Nemat,

I have the same problem (message is sent twice).

Did you found solution?

hi MIJAKO,
Probably you are calling it twice,it will be sent only once...Put Ur code below for more..
Nithin
nithin_in
Freshman
Freshman
 
Posts: 7
Joined: Fri Feb 19, 2010 9:43 am

Top
Next

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests