Click here to Skip to main content
Sign Up to vote bad
good
Hi there I need Urgent help please I am trying to connect to a FTP server but it bombs out at
mFTPClient = new FTPClient();
 
with this error when I mouse over FTPClient();
Quote:
Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.

 
I Have downloaded the library file for
import org.apache.commons.net.ftp.*;
From http://commons.apache.org/net/download_net.cgi[^]
 
The full connection method is
 
public boolean ftpConnect(String host, String username,String password, int port){
 
                try {
                 mFTPClient = new FTPClient();
                 // connecting to the host
                 mFTPClient.connect(host, port);
 
                 // now check the reply code, if positive mean connection success
                 if (FTPReply.isPositiveCompletion(mFTPClient.getReplyCode())) {
                     // login using username & password
                     boolean status = mFTPClient.login(username, password);
 
                     /* Set File Transfer Mode
                      *
                      * To avoid corruption issue you must specified a correct
                      * transfer mode, such as ASCII_FILE_TYPE, BINARY_FILE_TYPE,
                      * EBCDIC_FILE_TYPE .etc. Here, I use BINARY_FILE_TYPE
                      * for transferring text, image, and compressed files.
                      */
                     mFTPClient.setFileType(FTP.BINARY_FILE_TYPE);
                     mFTPClient.enterLocalPassiveMode();
                     Toast.makeText(getBaseContext(),"Connected!!",Toast.LENGTH_LONG).show();
                     return status;
                 }
             } catch(Exception e) {
                 Toast.makeText(getBaseContext(),"failed "+e+"/r/n Could not connect to"+host,Toast.LENGTH_LONG).show();
             }
 
             return false;
            }
 
please as I am still new to android and java development ANY help would be appreciated
 
The toast's are just for device test that I am able to see where it succeeds and where it fails
 
Kind Regards
A.J Bosch
Posted 23 Nov '12 - 1:00


1 solution

PLease follow that link which will guide you to full example about FTP in android :
FTP in Android
 
Regards...
  Permalink  
Comments
A.J Bosch - 23 Nov '12 - 8:08
don't know if you noted that I have the exact same connection method from that site I have downloaded the library file and added it to my project yet it needs a Javadoc that I know nothing of and also cant find it as a file only view it on the site in my question
Tamer Hatoum - 23 Nov '12 - 8:20
this is depending how you are adding your dependencies Go to Project=>Properties and select "Java Build Path" Select "Order and Export" tab Move "android 2.x.x" and "Android Dependencies" to the top of the list
Tamer Hatoum - 23 Nov '12 - 8:21
also follow that link will guide you how to add the file : http://lavalatwork.blogspot.com/2010/09/using-apache-commons-ftp-library-in.html
A.J Bosch - 27 Nov '12 - 7:27
thanx a lot there was a problem with my setup of the library file 1st right click on project=> Import=> expand general=> select archive File=> browse for your library file in my case commons-net-3.1.jar then click finish 2nd right click on project=> Properties=> select libraries tab=> Add external JARs=> then browse for the same file in my case commons-net-3.1.jar => click open=> and then ok "javadoc.jar missing" error is no more

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 484
1 Mahesh Bailwal 398
2 Maciej Los 215
3 CPallini 175
4 Aarti Meswania 173
0 Sergey Alexandrovich Kryukov 9,417
1 OriginalGriff 7,204
2 CPallini 3,933
3 Rohan Leuva 3,211
4 Maciej Los 2,743


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 23 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid