Implementing code for sending SMS?
<p>I have written code with the intention to send SMS, it work successfully with emulators, but fails on real devices! Can the community help me identify any problems with my code or any relevant information and links to assist me?</p>

<pre><code>public class SmsActivity extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);        
        final Button sendSms = (Button) findViewById (R.id.smsBut);
        sendSms.setOnClickListener(new View.OnClickListener() {         
            public void onClick(View v) {
            // TODO Auto-generated method stub              
            sendSMS("5556", "'hello frinds");
            sendSMS("*********", "'hello frinds");// **= real number
            }
        });

    }// end onCr

    public void sendSMS (String phoneNo, String msg) {      
        PendingIntent pi = PendingIntent.getActivity(this, 0,
            new Intent(this, SmsActivity.class), 0);                
        SmsManager sms = SmsManager.getDefault();       
        sms.sendTextMessage(phoneNo, null, msg, null, null);
    }    
}
</code></pre>

<h2>This is the manifest:</h2>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="sms.ecp.ccc"
        android:versionCode="1"
        android:versionName="1.0"&gt;
            &lt;uses-sdk android:minSdkVersion="10" /&gt;
            &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
            &lt;application android:icon="@drawable/ic_launcher"android:
                label="@string/app_name" &gt;
            &lt;activity android:name=".SmsActivity" android:label="@string/app_name" &gt;
                &lt;intent-filter&gt;
                    &lt;action android:name="android.intent.action.MAIN" /&gt;
                    &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
                &lt;/intent-filter&gt;
            &lt;/activity&gt;
        &lt;/application&gt;
    &lt;/manifest&gt;   
</code></pre>
