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. Stylus untuk Galaxy Tab


Mohon info.
Apakah tahu yang jual stylus seperti ini?
Di mana dan berapa harganya?
Stylus ini juga ada fungsi bluetooth-nya.

Terima kasih.



2. Aplikasi recomended

Dear rr...

Ada iPad China dengan OS Android.. ane mau coba install2..

Kira2 aplikasi apa yang direkomenfasikan nih ...?


Ahmad Syahruddin
Altiris & TrendMicro  Admin - HP


3. layout editor in 2.3 SDK sucks! Sorry but it does.

4. Jam dengan tampilan huruf

5. howto receive all broadcast messages

6. Making cross-thread blocking/sync calls

7. TextView setCompoundDrawables inconsistent size