FTP on android

by tiwana » Sun, 12 Apr 2009 00:36:29 GMT

Sponsored Links

I am having problem running FTP client on android. I know there are no
FTP libraries on android,
so i downloaded commons-net-1.4.1.jar and added it to my project.

But my app is not able to connect to any ftp server. This is the code,

import org.apache.commons.net.ftp.FTPClient;


ftp.login(username, password);

My app just hangs a ftp.connect(server).

Please help.


FTP on android

by Mark Murphy » Sun, 12 Apr 2009 00:44:44 GMT


Did you add the INTERNET permission to your AndroidManifest.xml file?

Are you someplace where firewalls may pose an issue?

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Training:  http://commonsware.com/training.html 


Sponsored Links

FTP on android

by tiwana » Sun, 12 Apr 2009 00:57:53 GMT

 Yes Mark,

I did add the INTERNET permission. I dont think there is an issue with
firewall, because i can use ftp from my computer
to the same ftp server. I have tried apps with HTTP post and they are
working correctly.

Thanks for the reply


FTP on android

by Mark Murphy » Sun, 12 Apr 2009 01:12:35 GMT


Bear in mind that the Android emulator runs in a virtual machine (qemu).
Just because you can get to the FTP server from your desktop does not
necessarily mean you can get to it from the virtual machine.

Have you tried AndFTP or other existing FTP apps on your emulator to see
if they work with this server? If they fail, I suspect it may be a
networking issue.

Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to Android Development_ Version 2.0 Available!


FTP on android

by David Given » Sun, 12 Apr 2009 01:36:03 GMT

Hash: SHA1


Also, don't forget that depending on how you FTP session is configured
then the server might need to make a connection back to your Android
system --- FTP is a ghastly protocol, and needs to be configured just
right (PASV) to avoid this:


- --
€€  €€€€€  http://www.cowlark.com  €€€€€
"All power corrupts, but we need electricity." --- Diana Wynne Jones,
_Archer's Goon_
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -  http://enigmail.mozdev.org 



FTP on android

by tiwana » Sun, 12 Apr 2009 02:07:45 GMT

 Actually my bucket upload is also not working.It is not able to
connect to any FTP server. What settings do i need to change?


FTP on android

by tiwana » Sun, 12 Apr 2009 05:39:22 GMT

 By th way the problem is with my dev phone not with emulator, emulator
is working fine.


FTP on android

by Marco Nelissen » Sun, 12 Apr 2009 11:54:57 GMT

 Are you accessing the server through wi-fi, or through the carrier network?
If the latter, make sure it's actually accessible from your carrier's network.


FTP on android

by tiwana » Tue, 14 Apr 2009 04:34:32 GMT

 I am using wifi. Now actually my AndFTP is working but still no change
in the app i wrote.



Other Threads

1. LK2.08 for original firmware

as subject

silakan lihat lihat hehe


"Indonesian Android Community [id-android]" 

2. Android market hiding apps with bluetooth permissions from Android 1.5 and 1.6

Seems like a work-around for that would be to have a base app that only
requests the base permissions, and have it on-demand install an optional
add-on that requests the additional permissions.  The base app calls
into the add-on to do the additional functionality.


3. resolution visibilty on Android Market

4. Easy and fast XML Parser?

5. Android for newbie

6. OOT: Andaikan OS-nya android...

7. App launching