Hello ,
currently I'm writing an android application that needs a file on a
ftp-server (drivehq) to operate properly .
Because the ftpclient of sun doesn't work for android ,I used the
ftpclient of apache.commons .
When i debug up my app on the device (htc wildfire) , it gives me an
IO-message who just says : "ERROR: ftp.drivehq.com" ;
I don't understand this problem an I'm pretty new to developping
android apps .
package me.Test.test;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.UnknownHostException;
import android.app.Activity;
import org.apache.commons.net.ftp.*;
import android.os.Bundle;
import android.widget.TextView;
public class TestActivity extends Activity {
private String serverIP ;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try {
FTPClient ftpclient = new FTPClient() ;
TextView tv = new TextView(this) ;
tv.setText("Looking for server ip-address...");
setContentView(tv);
InetAddress ftpaddr = InetAddress.getByName("ftp.drivehq.com");
ftpclient.connect(ftpaddr ) ;
ftpclient.login("username","password" ) ;
setContentView(tv) ;
ftpclient.changeWorkingDirectory("/ServerAddress");
String[] name = ftpclient.listNames() ;
tv.setText(name[1]) ;
setContentView(tv) ;
}
catch (IOException e) {
TextView tv1 = new TextView(this) ;
tv1.setText("ERROR: " + e.getMessage()) ;
setContentView(tv1) ;
System.out.println(e.getMessage()) ;
e.printStackTrace() ;
}
}
public void getServerIp() {
}
}
Greetings Tom
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en