Android™
Android™
FTP Uncommon Compatibility Options
See more FTP Examples
Demonstrates the UncommonOptions property, a comma-separated list of compatibility options for uncommon platform or server requirements. The default is empty and should normally remain empty.
Background: This is a catch-all for narrow workarounds that do not warrant their own properties — behaviors needed only by a particular server or platform quirk. Most applications never set it. When you do, it is to satisfy a specific documented requirement, and the exact keyword matters, so consult the reference list rather than guessing.
Chilkat Android™ Downloads
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean success = false;
CkFtp2 ftp = new CkFtp2();
ftp.put_Hostname("ftp.example.com");
ftp.put_Username("myFtpLogin");
// Normally you would not hard-code the password in source. You should instead obtain it
// from an interactive prompt, environment variable, or a secrets vault.
ftp.put_Password("myPassword");
// UncommonOptions is a comma-separated list of compatibility options for uncommon platform or
// server requirements. The default is empty and should normally remain empty; set a documented
// keyword only to work around a specific server or platform quirk.
ftp.put_UncommonOptions("SomeDocumentedKeyword");
success = ftp.Connect();
if (success == false) {
Log.i(TAG, ftp.lastErrorText());
return;
}
Log.i(TAG, "Connected.");
success = ftp.Disconnect();
if (success == false) {
Log.i(TAG, ftp.lastErrorText());
return;
}
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}