FTP Upload and Download on Android

后端 未结 2 609
野趣味
野趣味 2021-01-13 01:21

I get this error after i have set INTERNET_ACCESS and etc...

 private class AsyncUpload extends AsyncTask{       
    public void f         


        
2条回答
  •  滥情空心
    2021-01-13 02:00

            con.connect("ftp.194.90.81.149"); //here i recieve exception
                //the exception is java.unknownhostexception
                //java.net.UnknownHostException: Unable to resolve host "ftp.194.90.81.149": No address associated with hostname
    

    The fact that you're receiving an UnknownHostException means that ftp.194.90.81.149 isn't a real hostname in DNS. I'd suspect that the numeric part of that is what you really want. I.e, try changing that line to

    con.connect("194.90.81.149");
    

提交回复
热议问题