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. welcome... Android ?

Hi guys

I'd like to start working on Android platform in parallel with the
iPhone....
but seems quite impossible to start even installing the SDK....
not clear if compatible or not with  OS X 10.6.2
no clear installation for the latest OS X....

I downloaded  Mac OS X (intel)  android-sdk_r05-mac_86.zip   from this
page
http://developer.android.com/sdk/index.html

installed it, and launched  'tools/android' in the console, and got
Starting Android SDK and AVD Manager
Warning: The Mac OS -XstartOnFirstThread: is currently unsupported
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
Trace/BPT trap

I read also that SDK Tools, Revision 5 (March 2010) Fixes issue with
64-bit JVM on Window , BUT not on OS X 10.6 ?

I tried also to modify the Java Preferences SE 6 32-bits first ...
same issue

so is it or not supported ???
not sure that google android likes apple os x these last days..... so
should I forgot this platform ?

-- 

2. Buying a new Android phone - can I keep my apps?




If you're signing in to the new phone with the same Google account you used
to buy them, they should be there waiting for you when set up your new
phone.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 

3. Market spams by Genwi

4. Building kernel for I/O device

5. Android File System Permission (Accessing Private folder in file system)

6. Crash in call to opeCameraHardware()

7. transforming an activity to a modal full screen dialog