我正在为android制作客户端服务器应用程序,其中客户端是android,服务器是本地服务器。它在模拟器上成功运行,但不在设备上。它实际上并没有崩溃,而是从服务器给出响应
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>ERROR: The requested URL could not be retrieved</title>
</head>
<body>
<div id="content">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
<hr/>
<P>
While trying to retrieve the URL:
<A HREF="http://10.0.2.2/test/testing.php">http://10.0.2.2/test/testing.php</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Connection to 10.0.2.2 Failed
</STRONG>
</UL>
<P>
The system returned:
<PRE><I> (110) Connection timed out</I></PRE>
<P>
The remote host or network may be down. Please try the request again.
<P>Your cache administrator is <A HREF="mailto:webmaster">webmaster</A>.
</div>
<!--
-- Unfortunately, Microsoft has added a clever new
-- feature to Internet Explorer. If the text in
-- an errors message is too small, specifically
-- less than 512 bytes, Internet Explorer returns
-- its own error message. Yes, you can turn that
-- off, but *surprise* its pretty tricky to find
-- buried as a switch called smart error
-- messages That means, of course, that many of
-- Resins error messages are censored by default.
-- And, of course, youll be shocked to learn that
-- IIS always returns error messages that are long
-- enough to make Internet Explorer happy. The
-- workaround is pretty simple: pad the error
-- message with a big comment to push it over the
-- five hundred and twelve byte minimum. Of course,
-- thats exactly what youre reading right now.
//-->
</body></html>
我正在使用 httpclient 和 url 是 10.0.2.2 并且还使用互联网权限和 USB 调试。我只想在设备上运行。有没有我必须在移动设备上更改的设置或在 android 清单文件中更改 android 项目或任何想法。