lomza
lomza

Reputation: 9746

Send a message from one Android emulator to another?

I wonder how to send the message from, let's say, the server simulator, which is a Android project and is running on 5554 port to another Android project which is a client on 5556 port? I need this message to display on the screen and I have no idea how to make this connection.

Upvotes: 3

Views: 8472

Answers (3)

Pratik Popat
Pratik Popat

Reputation: 3009

using emulator Number (top left of device e.g 5554 , 5556) you can do this. enter this number as phone number and send message .

Upvotes: 12

Kamil
Kamil

Reputation: 2860

Simple sending SMS can be realized by this code

PendingIntent pi = PendingIntent.getActivity(this, 0,
        new Intent(this, SMS.class), 0);                
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage(phoneNumber, null, message, pi, null);

If you want to send message from one device to another just put its port into a phoneNumber.

Upvotes: 1

success_anil
success_anil

Reputation: 3658

Please reference the SMSTest sample app uploaded in the Files section. It shows how to send SMS between two emulators using SMSManager APIs: http://groups.google.com/group/android-developers/files

Upvotes: 1

Related Questions