Reputation: 2484
Does anyone know of a way to simulate an outgoing sms in an android emulator?
Upvotes: 2
Views: 468
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