ANDROID API的变化

ANDROID API的变化,android,api,Android,Api,我被赋予了修改Android应用程序的任务。它使用的API位于主服务器上,而我现在无法访问它。在源代码中,我将API的URL从 private static String URL = "https://website/App_API/index.php"; 到 为了进行一些测试,但在更改后,应用程序表示“没有可用的internet连接”。任何人对如何访问本地API有任何建议吗?如果您使用的是emulator,请尝试以下方法 private static String URL = "http:/

我被赋予了修改Android应用程序的任务。它使用的API位于主服务器上,而我现在无法访问它。在源代码中,我将API的URL从

private static String URL = "https://website/App_API/index.php";


为了进行一些测试,但在更改后,应用程序表示“没有可用的internet连接”。任何人对如何访问本地API有任何建议吗?

如果您使用的是emulator,请尝试以下方法

private static String URL = "http://10.0.2.2/App_API/index.php";

这就是解释。

要访问本地主机,您必须使用ip而不是ie

String URL = "http://10.0.2.2/App_API/index.php";

请参见

您是否在本地主机上正确部署了服务,或者是什么???使用计算机
ip更改本地主机
您所说的本地主机是什么意思?您在哪里部署了服务器?
String URL = "http://10.0.2.2/App_API/index.php";