【发布时间】:2011-11-16 17:27:56
【问题描述】:
当我使用这种方法从 ddms 上传文件时,我有一个 UnknownHostException:
try {
SimpleFTP ftp = new SimpleFTP();
// Connect to an FTP server on port 21.
ftp.connect("ftp://*******", 21, "*****", "*****");
// Set binary mode.
ftp.bin();
// Change to a new working directory on the FTP server.
ftp.cwd("web");
// Upload some files.
ftp.stor(new File("data/data/com.android/file/contacts"));
// Quit from the FTP server.
ftp.disconnect();
}
catch (IOException e) {
// Jibble.
}
这种方法有什么问题?任何人都可以澄清我。
【问题讨论】:
-
你应该包括 logcat
-
@David Olsson:如何包含 logcat。请告诉我方法。
-
在终端中使用 adb logcat。或者 eclipse 中的 logcat 视图。
标签: android file-upload ftp