jsp 插入后我使用以下代码向android发送成功或失败
response.setContentType("text/html");
ObjectOutputStream oos = new ObjectOutputStream(response.getOutputStream());
oos.writeObject("success");
out.print("success");
在 android 中我使用以下代码
接收数据HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.mysite.com.au/validation1.jsp");
List<NameValuePair> namevaluepairs = new ArrayList<NameValuePair>(2);
namevaluepairs.add(new BasicNameValuePair("pin",pass));
httppost.setEntity(new UrlEncodedFormEntity(namevaluepairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity rp = response.getEntity();
String origresponseText = EntityUtils.toString(rp);
String responseText = origresponseText.substring(7, origresponseText.length());
Toast.makeText(getApplicationContext(), "Incoming data-->"+responseText, Toast.LENGTH_SHORT).show();
if(responseText.equals("success")){
// do something
}
使用此代码从JSP接收DATAS是否有任何缺陷
我的应用程序在我的手机中完美运行,即sony xperia ....但同样的应用程序在其他一些手机中没有响应并不是全部....有人可以告诉我背后的原因是什么