我得到了这个ftp上传方法:
try {
SimpleFTP ftp = new SimpleFTP();
// Connect to an FTP server on port 21.
ftp.connect("ftp.atw.hu", 21, "username", "password");
// 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("/mnt/sdcard/Documents/Festivale.db"));
//ftp.stor(new File("comicbot-latest.png"));
// You can also upload from an InputStream, e.g.
// ftp.stor(new FileInputStream(new File("test.png")), "test.png");
// ftp.stor(someSocket.getInputStream(), "blah.dat");
// Quit from the FTP server.
ftp.disconnect();
} catch (IOException e) {
// Jibble.
}
我用以下日志强制关闭:
08-27 14:26:09.037: E/AndroidRuntime(2378): FATAL EXCEPTION: main
08-27 14:26:09.037: E/AndroidRuntime(2378): java.lang.NoClassDefFoundError: org.jibble.simpleftp.SimpleFTP
08-27 14:26:09.037: E/AndroidRuntime(2378): at com.example.festivale_v2.main$8.onClick(main.java:106)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.view.View.performClick(View.java:2485)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.view.View$PerformClick.run(View.java:9080)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.os.Handler.handleCallback(Handler.java:587)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.os.Handler.dispatchMessage(Handler.java:92)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.os.Looper.loop(Looper.java:123)
08-27 14:26:09.037: E/AndroidRuntime(2378): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-27 14:26:09.037: E/AndroidRuntime(2378): at java.lang.reflect.Method.invokeNative(Native Method)
08-27 14:26:09.037: E/AndroidRuntime(2378): at java.lang.reflect.Method.invoke(Method.java:507)
08-27 14:26:09.037: E/AndroidRuntime(2378): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-27 14:26:09.037: E/AndroidRuntime(2378): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-27 14:26:09.037: E/AndroidRuntime(2378): at dalvik.system.NativeStart.main(Native Method)
有人可以告诉我有什么问题吗?我已经在我的手机上尝试过,导致同样的错误。它有互联网许可。