Why Sms Sending Not Working?
<p>I want to develop an android application whic'll send free SMS my code is bellow which 
   there is no any responce,please anyone help me?</p>

<pre><code>private void setAllControlls()
{

    b1 = (Button)findViewById(R.id.ok);
    b1.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            postmsg();
        }
    });
}

private void postmsg()
{

    String responce=null;
    try {
        responce =buildRequestString("mobile no","hello");
        System.out.println("----responce----"+responce);
    } catch (UnsupportedEncodingException e1) {
        e1.printStackTrace();
    }

      //call here
      String testPhoneNo = "reciever";
       String testMessage = "Sending Messages From java is not too hard";
    try {
        sendMessage(testPhoneNo,testMessage);
    } catch (Exception e) {
        e.printStackTrace();
    }

}

public static void sendMessage(String reciever, String message) throws Exception
{

        final String _url ="http://ubaid.tk/sms/sms.aspx";//http://ubaid.tk/sms/sms.aspx&lt;/a&gt;";&lt;/span&gt;
     final String charset = "UTF-8";
        //To establish the connection and perform the post request
         URLConnection connection = new URL(_url + "?" + buildRequestString(reciever,message)).openConnection();
connection.setRequestProperty("Accept-Charset", charset);

//This automatically fires the request and we can use it to determine the response status
InputStream response = connection.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(response));
System.out.println(br.readLine());
}

         //to build the query string that will send a message
private static String buildRequestString(String targetPhoneNo, String message) throws UnsupportedEncodingException 
{
    //Replace your way2sms username and password below
    final String userName = "way2sms no";
    final String _password = "pwd";
     final String charset = "UTF-8";
    String [] params = new String [5];
    params[0] = userName;
    params[1] = _password;
    params[2] = message;
    params[3] = targetPhoneNo;
    params[4] = "way2sms";

String query = String.format("uid=%s&amp;amp;pwd=%s&amp;amp;msg=%s&amp;amp;phone=%s&amp;amp;provider=%s",
URLEncoder.encode(params[0],charset),
URLEncoder.encode(params[1],charset),
URLEncoder.encode(params[2],charset),
URLEncoder.encode(params[3],charset),
URLEncoder.encode(params[4],charset)
);
return query;
}
</code></pre>

<p>there is no any exception but this code is not working.My require is that make an android application which send free text SMS.</p>
