I am encountering exactly the same issue. I get a reply of 230 in both applications. The Java application returns all files from a getFiles() method call while the Android application returns 0 with a negative 500 reply checking the reply code afterwards. I gave INTERNET permission in the manifest file. Did anybody solve this problem? Best Regards Ivan
Am Montag, 7. Dezember 2009 16:33:57 UTC+1 schrieb Chander Pechetty: > As far as I can tell, there is no compatibility problem. Enable server > logging and see if you get a "250 or [some number] directory OK", and > hopefully its the same code you are running with the same account; it > could be a minor bug somewhere else....:-) > > > -Chander > www.unisaran.com > > On Dec 6, 8:26 pm, armstrong <armstrongh...@gmail.com> wrote: > > Hi, all > > > > I am writing a ftp client on android sdk 1.5 with apache-commons-net- > > ftp-2.0. I can successfully connect to my testing ftp server but with > > I use listFiles() it return an empty FTPFile[]. > > > > I put the same code in a normal java program and it works fine. I > > don't know where is wrong. Any compatible problem when apache-commons- > > net-ftp-2.0 and android works together? > > > > Here is my test code: > > > > FTPClient ftpClient = new FTPClient(); > > try { > > ftpClient.connect("192.168.1.102", 21); > > ftpClient.login("testftp", "testftp"); > > Thread.currentThread().sleep(5000); > > System.out.println("bbbbbb: " + > ftpClient.getReplyString()); > > FTPFile[] ftpFiles = > ftpClient.listFiles(); > > System.out.println("aaaaaa: " + > ftpFiles.length); > > } catch (Exception e) { > > e.printStackTrace(); > > } > > > > android output: > > bbbbbb: 230 Login successfully. > > aaaaaa: 0 > > > > j2se output: > > bbbbbb: 230 Login successfully. > > aaaaaa: 5 > > > > It is actually 4 files and 1 directory in the ftp root! > > > > Maybe someone asked the same thing before. Some suggestion? > > > > Thanks in advance! > Am Montag, 7. Dezember 2009 16:33:57 UTC+1 schrieb Chander Pechetty: > > As far as I can tell, there is no compatibility problem. Enable server > logging and see if you get a "250 or [some number] directory OK", and > hopefully its the same code you are running with the same account; it > could be a minor bug somewhere else....:-) > > > -Chander > www.unisaran.com > > On Dec 6, 8:26 pm, armstrong <armstrongh...@gmail.com> wrote: > > Hi, all > > > > I am writing a ftp client on android sdk 1.5 with apache-commons-net- > > ftp-2.0. I can successfully connect to my testing ftp server but with > > I use listFiles() it return an empty FTPFile[]. > > > > I put the same code in a normal java program and it works fine. I > > don't know where is wrong. Any compatible problem when apache-commons- > > net-ftp-2.0 and android works together? > > > > Here is my test code: > > > > FTPClient ftpClient = new FTPClient(); > > try { > > ftpClient.connect("192.168.1.102", 21); > > ftpClient.login("testftp", "testftp"); > > Thread.currentThread().sleep(5000); > > System.out.println("bbbbbb: " + > ftpClient.getReplyString()); > > FTPFile[] ftpFiles = > ftpClient.listFiles(); > > System.out.println("aaaaaa: " + > ftpFiles.length); > > } catch (Exception e) { > > e.printStackTrace(); > > } > > > > android output: > > bbbbbb: 230 Login successfully. > > aaaaaa: 0 > > > > j2se output: > > bbbbbb: 230 Login successfully. > > aaaaaa: 5 > > > > It is actually 4 files and 1 directory in the ftp root! > > > > Maybe someone asked the same thing before. Some suggestion? > > > > Thanks in advance! > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en