FTP on android

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


Sponsored Links
 HI,

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.connect(server);
ftp.login(username, password);
ftp.logout();
ftp.disconnect();

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
Birjodh






--~--~---------~--~----~------------~-------~--~----~



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


 -----BEGIN PGP SIGNED MESSAGE-----
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://slacksite.com/other/ftp.html 

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

iD8DBQFJ4NTRf9E0noFvlzgRArcJAJ9PaPtNzwl35G+ziZH+wWXKjCLCfgCfWvl/
G6lErc/AmwUU36VYUb1K1Fs=
=PFsP
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~



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.

Thanks
Birjodh








--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Stylus untuk Galaxy Tab

Rekans,

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

Terima kasih.



Baskoro

-- 
===============
"

2. Aplikasi recomended

Dear rr...

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


Kira2 aplikasi apa yang direkomenfasikan nih ...?

Trim's

-- 
Ahmad Syahruddin
========================
Altiris & TrendMicro  Admin - HP
+6285624120322

-- 
===============
"

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