Sending an SMS in an Android application
<p>I made a send application. How can I check message sending without an actual device?</p>

<pre><code>sendSms.setOnClickListener(new View.OnClickListener()
{
    public void onClick(View v)
    {
        //Toast.makeText(getApplicationContext(),template+"and"+phoneNumber,Toast.LENGTH_LONG).show();
        if (phoneNumber.length()&gt;0 &amp;&amp; template.length()&gt;0)
        {
            sendSMS(phoneNumber, template);
        }
        else
            Toast.makeText(getApplicationContext(), "please select name &amp; template",Toast.LENGTH_SHORT).show();
    }

    private void sendSMS(String phoneNumber, String template)
    {
        PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,new Intent(getApplicationContext(),Test2Activity.class), 0);
        SmsManager sms = SmsManager.getDefault();
        sms.sendTextMessage(phoneNumber, null, template, pi, null);
    }
});
</code></pre>
