Fred Ondieki
Fred Ondieki

Reputation: 2484

Is there a way that I can simulate an outgoing sms in an Android Emulator?

Does anyone know of a way to simulate an outgoing sms in an android emulator?

Upvotes: 2

Views: 468

Answers (1)

Ram kiran Pachigolla
Ram kiran Pachigolla

Reputation: 21181

yes it will be possible by using opening two emulators at same time.

For suppose if your emulator numbers are 5554 and 5556.

btnSendSMS = (Button) findViewById(R.id.btnSendSMS);
btnSendSMS.setOnClickListener(new View.OnClickListener()
  {
     public void onClick(View v)
     {
         sendSMS("5556", "Hi You got a message!");                     
      }
  });

private void sendSMS(String phoneNumber, String message)
{
   SmsManager sms = SmsManager.getDefault();
   sms.sendTextMessage(phoneNumber, null, message, null, null);
}

Upvotes: 5

Related Questions