title: Send demo sms via Twilio android eclipse
body: <p>i am new to android and trying to send message via twilio in android application.
  i have the SID and auth token.</p>
  
  <p>Here is my simple xml code.</p>
  
  <pre><code>&lt;EditText
      android:id="@+id/editText3"
      android:layout_width="wrap_content"
      android:layout_height="50dp" 
      android:layout_below="@+id/editText2"
      android:layout_marginTop="30dp"
      android:ems="10"
      android:layout_toRightOf="@+id/Message"
      android:inputType="phone" /&gt;
  
  &lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBaseline="@+id/editText1"
      android:layout_alignBottom="@+id/editText1"
      android:layout_alignParentLeft="true"
      android:text="TO" /&gt;
  
  &lt;TextView
      android:id="@+id/textView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/editText2"
      android:layout_alignParentLeft="true"
      android:text="From" /&gt;
  
  &lt;TextView
      android:id="@+id/Message"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBaseline="@+id/editText3"
      android:layout_alignBottom="@+id/editText3"
      android:layout_alignParentLeft="true"
  
      android:text="Message" /&gt;
  
  &lt;EditText
      android:id="@+id/editText2"
      android:layout_width="wrap_content"
      android:layout_height="30dp"
      android:layout_below="@+id/editText1"
      android:layout_marginTop="30dp"
      android:layout_toRightOf="@+id/Message"
      android:ems="10"
      android:inputType="phone" /&gt;
  
  &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="wrap_content"
      android:layout_height="30dp"
      android:layout_alignLeft="@+id/editText2"
      android:layout_alignParentTop="true"
      android:layout_marginTop="40dp"
      android:ems="10"
      android:inputType="phone" /&gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/editText3"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="44dp"
      android:text="Send Message" /&gt;
  </code></pre>
  
  <p>Here is the java source provided by Twilio...</p>
  
  <pre><code>package com.example.twilio_poc;
  
  import java.util.HashMap;
  import java.util.Map;
  
  import com.twilio.sdk.TwilioRestClient;
  import com.twilio.sdk.TwilioRestException;
        import com.twilio.sdk.TwilioRestResponse;
    import com.twilio.sdk.resource.factory.SmsFactory;
    import com.twilio.sdk.resource.instance.Account;
     import com.twilio.sdk.resource.instance.Sms;
  
  
  public class SendNotifications {
  /* Twilio REST API version */
  public static final String ACCOUNTSID = "XXXXXXXXXXXXXXXXX";
  public static final String AUTHTOKEN = "XXXXXXXXXXXXXXXXX";
  
  public static void main(String args[]){
  
      /* Instantiate a new Twilio Rest Client */
      TwilioRestClient client = new TwilioRestClient(ACCOUNTSID, AUTHTOKEN);
  
      // Get the account and call factory class
      Account acct = client.getAccount();
      SmsFactory smsFactory = acct.getSmsFactory();
  
      //build map of server admins
      Map&lt;String,String&gt; admins = new HashMap&lt;String,String&gt;();
      admins.put("4158675309", "Johnny");
      admins.put("4158675310", "Helen");
      admins.put("4158675311", "Virgil");
  
      String fromNumber = "YYY-YYY-YYYY";
  
      // Iterate over all our server admins
      for (String toNumber : admins.keySet()) {
  
          //build map of post parameters 
          Map&lt;String,String&gt; params = new HashMap&lt;String,String&gt;();
          params.put("From", fromNumber);
          params.put("To", toNumber);
          params.put("Body", "Bad news " + admins.get(toNumber) + ", the server is down and it needs your help");
  
          try {
              // send an sms a call  
              // ( This makes a POST request to the SMS/Messages resource)
              Sms sms = smsFactory.create(params);
              System.out.println("Success sending SMS: " + sms.getSid());
          }
          catch (TwilioRestException e) {
              e.printStackTrace();
          }
      }
  }       
  </code></pre>
  
  <p>}</p>
  
  <p>i have no idea what and how should i do this.
  so if you please.</p>