Android应用模拟器不能在localhost上运行

时间:2015-01-20 17:13:13

标签: android android-emulator localhost

我有2台笔记本电脑。一个是Windows,一个是Linux(Ubuntu)。在Windows机器上,我无法运行Android模拟器应用程序。我尝试使用http://localhost/http://10.0.2.2/并且没有工作。在Linux机器上一切正常。可能是什么问题?

我使用过Eclipse。并在机器localhost WAMP。

更新

我有这个代码,我尝试通过应用程序打开。当我在我的本地http://localhost/file.php运行它时,显然我得到了deprecated mysql_*函数的错误,但结果显示(在网络主机上我没有得到这个错误)。我试图在php.ini中转换display_errors,我注意到该应用程序不再崩溃而且一切都在运行。这真的有可能导致这个问题吗?

<?php
$objConnect = mysql_connect("localhost","database","");
$objDB = mysql_select_db("tableName");

$strSQL = "SELECT * FROM res";
$objQuery = mysql_query($strSQL);
$intNumField = mysql_num_fields($objQuery);
$resultArray = array();
while($obResult = mysql_fetch_array($objQuery))
{
    $arrCol = array();
    for($i=0;$i<$intNumField;$i++)
    {
        $arrCol[mysql_field_name($objQuery,$i)] = $obResult[$i];
    }
    array_push($resultArray,$arrCol);
}

mysql_close($objConnect);
echo json_encode($resultArray);
?>

0 个答案:

没有答案
相关问题