title: Android send SMS automatically on button click
body: <p>I am trying to automatically send SMS message to a certain number when the user presses a button on the screen.</p>
  
  <p>This is my code:</p>
  
  <pre><code>Intent smsIntent = new Intent(Intent.ACTION_SENDTO,
  Uri.parse("sms:xxxxxxxxxxx")); 
  smsIntent.putExtra("sms_body", "Hello");
  startActivity(smsIntent);
  </code></pre>
  
  <p>xxxxxxx = phone number</p>
  
  <p>I have the following permissions: </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.SEND_SMS"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_SMS"&gt;&lt;/uses-permission&gt;
  </code></pre>
  
  <p>When I press the button it takes me to another screen where I can edit my text and press Send. I just want it to do this process automatically without taking me to another screen. As I've already defined my message, I just want to send it to a particular number. </p>
  
  <p>And also I am not sure if I put the corrent phone number in the second line of code. Do I have to put my country code in there first or can I just put my mobile phone number and it will work?</p>
  
  <p>Thank you</p>