基本上,当我尝试请求 http 连接时,我遇到的唯一错误是,
Error in http connection !! android.os.NetworkOnMainThreadException
我正在尝试使用 android 模拟器连接到我的 Wamp 服务器中的数据库,这是我使用的代码的一部分,
response = CustomHttpClient.executeHttpPost(
"http://152.226.152.96:89/MPSIP/jsontestscript.php",
postParameters);
我也尝试使用 localhost 而不是我的 IP,但我会得到完全相同的错误。
我想知道如何与我的 wampserver 建立 http 连接。我是错过了一步还是我做错了。
如果有帮助,我使用了来自的指南,