我编写了一个应用程序,其中我通过模拟器使用系统的 IP 地址连接到本地主机,但现在我想通过 Android 设备连接到 LocalHost
问题是每当我尝试通过应用程序连接时遇到问题,简而言之:本地主机没有响应.....
我正在使用 Wifi 连接本地主机..请提供任何帮助....
代码:
public void onClick(View v) {
String url = "http://ipaddress/checkLogin.php";
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("strUser", txtUser.getText().toString()));
params.add(new BasicNameValuePair("strPass", txtPass.getText().toString()));
String resultServer = getHttpPost(url,params);
Log.d("Entire string::", " "+resultServer);