How to programmatically send SMS message to Emulator

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

How to programmatically send SMS message to Emulator

Postby puyopuy » Sun Feb 24, 2008 5:08 am

Hello all,

I'm trying to send sms message programmatically to Emulator using the following code without success, I tried port 5555 and 5554.

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


Any help is much appreciated.
Puyopuy
puyopuy
Junior Developer
Junior Developer
 
Posts: 17
Joined: Sun Feb 03, 2008 4:46 am

Top

Postby puyopuy » Sun Feb 24, 2008 8:45 am

Additional information.

I also tried to use SystemProperties to get the phone number but still doesn't work.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. String phoneNumber =
  3.  
  4.         android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_LINE1_NUMBER);
  5.  
  6.  
  7.  
  8. SmsManager sm = SmsManager.getDefault();
  9.  
  10. sm.sendTextMessage(phoneNumber , null, "Hello world", null, null, null);
  11.  
  12.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


When I Emulator Control to send SMS , my onReceiveIntent will response that mean it's not permission issue. Anyone got any idea?

Puyopuy
puyopuy
Junior Developer
Junior Developer
 
Posts: 17
Joined: Sun Feb 03, 2008 4:46 am

Postby plusminus » Sun Feb 24, 2008 10:08 pm

Hello puyopuy,

as far as I know outgoing sms are not handled. They just go out and ................ ;)

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 puyopuy » Mon Feb 25, 2008 1:42 am

Hello plusminus,

Thanks for your update, just hoping next version of SDK will fix this problem.

BTW, did you found out how to get all the SMS call log now? I knew that you asked this question in Android developer group last year.

Thanks
Jeff
puyopuy
Junior Developer
Junior Developer
 
Posts: 17
Joined: Sun Feb 03, 2008 4:46 am

Re: How to programmatically send SMS message to Emulator

Postby bindalandroid » Fri Jan 21, 2011 11:30 am

I need to know that can we intercept outgoing sms in android ,please let me know if it is possible ?
thanks in advance.
bindalandroid
Freshman
Freshman
 
Posts: 2
Joined: Tue Dec 28, 2010 11:15 am
Location: Ahmedabad,Gujarat,india

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests