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. Animating different views during the same animation


does anyone knows if it's possible to animate different views during
the same animation:
I have a linear layout containing 6 dices (each dice extends a
textview) and I need to animate each dice to simulate a roll (each
dice will rotate on itself).
I know how to do this rotation on each dice by using 6 animations, but
I want to group these animations in one, so that I would be able to
add an animation listener to execute further instructions at the end
of this animation. I tried with an animationset but didn't manage to
do it.

Thank you by advance.




2. memory fault detect application on Android platform


I want to know, is there any utility/software to detect memory (NOR/
NAND flash & RAM) fault on Android platform?
Like in linux memtest86+ and smartmontools.



3. Salam Kenal mohon bimbingan...

4. How to get metadata of song while playing in android

5. changing icon of application of home screen

6. Android 2.2 - Portable Hot Spot - WifiManager class

7. Having camera store snapped pictures