URL="http://localhost:81/update.asp?u=1&f=23.33"
在网页上执行URL是成功的。URL的localhost换成外网IP也是可以执行的成功的。
网页中执行成功返回1,不成功返回2。在android中执行就是不行。
TextView1.setText(strResult);
就没有值。有没有成功的实例。谢谢。
在网页上执行URL是成功的。URL的localhost换成外网IP也是可以执行的成功的。
网页中执行成功返回1,不成功返回2。在android中执行就是不行。
TextView1.setText(strResult);
就没有值。有没有成功的实例。谢谢。
解决方案 »
- 求如何获取手机SD卡上的xml用dom4j来解析
- Android可以实现跟HID设备的通讯吗?Java/Linux?
- android vpn编程
- Android中怎样设置ImageView的透明度?
- Android MediaPlayer 怎么实现快放?
- 如何导入 android.opengl.Object3D;android.pim.DateUtils;
- 怎样在android模拟器中模拟sd卡的插拔
- manifest 怎样绑定多个类?
- android 数据库导入
- 朋友们 帮帮 小弟
- Andorid 的模拟器,如何模拟双手触屏呢?
- 急求解android2.3上显示维语问题和出错,附维语显示思路代码
String responseContent = null;
try {
String queryUrl = reqUrl;
Log.d("TAG", "doGet url is: " + reqUrl);
URL url = new URL(queryUrl); url_con = (HttpURLConnection) url.openConnection(); url_con.setRequestMethod("GET");
if (timeOut == 0) {
url_con.setConnectTimeout(HttpUtil.connectTimeOut);
url_con.setReadTimeout(HttpUtil.readTimeOut);
} else {
url_con.setConnectTimeout(timeOut);
url_con.setReadTimeout(timeOut);
}
url_con.setDoOutput(false);
url_con.setDoInput(true); InputStream in = url_con.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(in,
recvEncoding));
String tempLine = rd.readLine();
StringBuffer temp = new StringBuffer();
String crlf = System.getProperty("line.separator");
while (tempLine != null) {
temp.append(tempLine);
temp.append(crlf);
tempLine = rd.readLine();
}
responseContent = temp.toString();
rd.close();
in.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (url_con != null) {
url_con.disconnect();
}
} return responseContent;
}
直接爆:Unfortunately,XXX has stopped.