如题,哥们最近要完成一个登陆功能的开发,客户端使用基于Http协议的POST方法向服务器发送已定义好的信令,实现客户端与服务器的交互。在此我使用的是HttpURLConnection进行网络通信。此前开发android2.3.3版本时木有问题,最近要开发android4.0.3版本,出现的问题是,在模拟器上可以实现登陆,但在手机上却无法登陆。(附上部分代码)
     
      
                     URL url = new URL("http://10.4.0.132:5060");
conn = (HttpURLConnection) url.openConnection();
//conn.setConnectTimeout(5* 1000);
conn.setDoOutput(true);//�������
conn.setDoInput(true);
conn.setUseCaches(false);//��ʹ��Cache
conn.setRequestMethod("POST");        
//conn.setRequestProperty("Connection", "Keep-Alive");//ά�ֳ�����
conn.setRequestProperty("Charset", "UTF-8");
conn.setRequestProperty("Content-Length", String.valueOf(xmlbyte.length));
conn.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
outStream = new DataOutputStream(conn.getOutputStream());
outStream.write(xmlbyte);//����xml���
debug运行,当手机执行到outStream = ````这一句就直接抛出IO异常了,但模拟器可以顺利执行,求各位大虾解答~!