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 Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/android-discuss?hl=en.