いつもお世話になっております。
いさむと申します。
さっそくですが、写真撮影後、保存したものをFTP経由で送信しようと考え、
AndFTPというアプリをIntentにて利用するということにたどり着きました。
単純にメニューをクリックしたら下記のように設定し、ファイルを送信するという
形にしたのですが、startActivityForResult(intent, 0);のタイミングでエラーが発生し、
異常終了してしまいます。
AndFTPのアプリで、同じ設定を行い、ファイルを送信したところ正しくアップロードが
できたので、Intentを利用するためにアプリの設定不足か、コーディングが間違っている
可能性が高いと考えています。
Intentにて他のアプリを利用している方でこの辺りの情報をお持ちの方がいらっしゃいましたら
ご指導いただけますと助かります。
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
// FTP URL (Starts with ftp://, sftp:// or ftps:// followed by hostname and port).
Uri ftpUri = Uri.parse("
ftp://192.168.24.100:21");
intent.setDataAndType(ftpUri, "vnd.android.cursor.dir/lysesoft.andftp.uri");
// FTP credentials (optional)
intent.putExtra("ftp_username", "test");
intent.putExtra("ftp_password", "test");
//intent.putExtra("ftp_keyfile", "/sdcard/dsakey.txt");
//intent.putExtra("ftp_keypass", "optionalkeypassword");
// FTP settings (optional)
intent.putExtra("ftp_pasv", "true");
//intent.putExtra("ftp_resume", "true");
intent.putExtra("ftp_encoding", "UTF8");
// Upload
intent.putExtra("command_type", "upload");
// Activity title
intent.putExtra("progress_title", "転送中 ...");
intent.putExtra("local_file1", "/sdcard/test.jpg");
// Optional initial remote folder (it must exist before upload)
intent.putExtra("remote_folder", "/");
startActivityForResult(intent, 0);
以上 よろしくお願いいたします。