我尝试在Android程序中使用 uthsms.net 发送免费短信...但无法接收短信任何手机号码..
我使用下面的代码,无法获得任何异常或错误....
我试过模拟器和设备两者都不是同样的问题,我最后一个弱点挣扎这个问题
请给我任何人关于uthsms.net的好建议
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost("http://www.uthsms.net/index.php?on=sms-status");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("country", "91"));
nameValuePairs.add(new BasicNameValuePair("sindh", "xxxxxxxxxxx"));
nameValuePairs.add(new BasicNameValuePair("gateway", "0"));
nameValuePairs.add(new BasicNameValuePair("hyderabad", "12345"));
nameValuePairs.add(new BasicNameValuePair("remLen", "135"));
nameValuePairs.add(new BasicNameValuePair("recaptcha_challenge_field", "03AHJ_VuvO-0yifgUvXaYPdlTF5QBZwKQlo-gQE8FYioRNi3klTtM_MLDnbzuOH8uUFzX1LXVltrZy8kBcTDY176rLVu3M1EvbkF3fQKxQ3t3nBedlshOvNXHZDFCO5I4Sdm4AkIdpQViTRBDzB6pU9OIombEKY6yy7OsY1Faob6Z47pNAaKWqFGc"));
nameValuePairs.add(new BasicNameValuePair("recaptcha_response_field", "2485842 76"));
nameValuePairs.add(new BasicNameValuePair("x", "126"));
nameValuePairs.add(new BasicNameValuePair("y", "31"));
nameValuePairs.add(new BasicNameValuePair("button", "Send SMS"));
try {
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
HttpResponse response = client.execute(post);
StatusLine statusLine = response.getStatusLine();
System.out.println("http responce code"+statusLine);
if(statusLine.getStatusCode() == 200) {
entity = response.getEntity();
Log.e(null,"entity"+ entity.toString());
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
sb = new StringBuilder();
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()), 65728);
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
}
catch (IOException e) {
e.printStackTrace();
}
catch (Exception e1) {
e1.printStackTrace();
}
System.out.println("finalResult " + sb.toString());