我想使用HttpConnection下载数据,请参见下面的示例
class ConnectionThread extends Thread
{
public void run()
{
try{
showToast("in the run method");
HttpConnection conn = null;
String URL = "http://xxxxxxx.com/api/api.php?func=showAllCountries;interface=wifi";
conn = (HttpConnection)Connector.open(URL);
}catch(Exception e){
showToast(e+"");
}
}当运行上面的代码时,在模拟器上它显示Java.io.IOException没有找到Wi-Fi连接,虽然在管理连接中我可以看到模拟器与Wi-Fi连接,请解释为什么会发生这种情况
请
发布于 2012-09-12 01:40:23
使用deviceside= false;
在模拟器wifi是不可能的,模拟器将访问您的系统网络,一旦您在真实设备上wifi将工作,如果它是在设备中启用。
Follow this link on how to make connections.
https://stackoverflow.com/questions/12369728
复制相似问题