I am new to Android and in my app I want to send an SMS to my phone without opening the existing MessageApp. To achieve this, I wrote the code below, but I am not receiving any messages in my phone.

What is the problem?

code:
-----

```
private void sendSms(String phoneNo, String msg) {
    try {
        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNo, null, msg, null, null);
        Toast.makeText(getApplicationContext(), "Message Sent",
                Toast.LENGTH_LONG).show();
    } catch (Exception ex) {
        Toast.makeText(getApplicationContext(), ex.getMessage().toString(),
                Toast.LENGTH_LONG).show();
        ex.printStackTrace();
    }
}

```

Also, I added the permission below to my manifesto file.

`<uses-permission android:name="android.permission.SEND_SMS"/>`