I've been trying to send message on Android 4.0 emulator via Broadcasting and fetch that message via Broadcast receiver. I'm able to do so with two emulators, say, from 5554 to 5556. However, I can't get the sent message from 5554 to itself. Here's the way I send a message:
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(number, null, message, sentPI, deliveredPI);
the number here is emulator's port number
No, you can not send SMS from an emulator to a cell phone, the simple and logical reason is that the emulators don't have a SIM Card.
Microsoft Telnet> (b)Assuming that your Emulator is already started.And while still on the CMD,type: o localhost 5554. this should open a connection to the emulator. (c)To Emulate an incoming sms from a number say 0123456 type: sms send 0123456 Your Message.
Now You can send an SMS or make a call using Emulator Control . In Eclipse go to window->show views->other->Emulator control . That is for sending/receiving SMS between built-in messaging application of the Android OS.
You can easily demonstrate that using tellnet command : in windows os if tellnet is off then you can turn on using following steps
Start
Control Panel
Programs And Features
Turn Windows features on or off
Check Telnet Client
Hit OK
then write the command like telnet localhost 5554 here 5554 is my emulator port number
once the connection has established
write the following command filling appropriated value
sms send 5554 hi
you will see the message has arrived in your emulator .
Yes,emulator can send messages to itself.
you can try it on your emulator.
Select messaging Application in your emulator and type your Avd no. of the emulator and send the message.
EDIT :
Reading this answer I have just tried it and Yes It's Taking the message.
I have opened my FirstAVD : 5554 and SecondAVD : 5556
then I go to Messaging :
created message to : 5554(itself) and 5556(to another) and It's showing the message to 5554 in Inbox and In avd 5556 message from FirstAVD in it's inbox.
So,Emulator sends message to itself. But while sending from one to another it will show notification and sending to itself will not show notification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With