AndFTPのIntentについて

134 views
Skip to first unread message

ISAMU TAKATA

unread,
Apr 9, 2010, 3:38:29 AM4/9/10
to android-g...@googlegroups.com
いつもお世話になっております。
いさむと申します。
さっそくですが、写真撮影後、保存したものを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);

以上 よろしくお願いいたします。

anzai...@gmail.com

unread,
Apr 9, 2010, 3:43:13 AM4/9/10
to android-g...@googlegroups.com
いさむさん

 あんざいです。
 logcat ではエラーになんと表示されていますか?
 エラーのログを載せたほうがアドバイスが得られやすいと思います。
 DDMS の logcat のエラー箇所を載せてはいかがでしょうか?

2010/04/09 16:38 ISAMU TAKATA <isamu...@gmail.com>:
> --
>
> このメールは Google グループのグループ「日本Androidの会」の登録者に送られています。
>
> このグループに投稿するには、android-g...@googlegroups.com にメールを送信してください。
>
> このグループから退会するには、android-group-j...@googlegroups.com にメールを送信してください。
>
>
> 詳細については、http://groups.google.com/group/android-group-japan?hl=ja からこのグループにアクセスしてください。
>

ISAMU TAKATA

unread,
Apr 9, 2010, 3:53:23 AM4/9/10
to android-g...@googlegroups.com
あんざいさん
 早急な回答ありがとうございます。
 04-09 16:42:29.509: VERBOSE/Error(1238): No Activity found to handle Intent { act=android.intent.action.PICK dat=ftp://192.168.24.100:21 typ=vnd.android.cursor.dir/lysesoft.andftp.uri (has extras) }
 というエラー表示がありました。

2010年4月9日16:43 <anzai...@gmail.com>:

あんざいゆき

unread,
Apr 9, 2010, 7:16:12 AM4/9/10
to android-g...@googlegroups.com
いさむさん

ログでは、この Intent を処理する Activity がないといわれているので、
Intent の設定値がおかしいか、
そもそも ACTION_PICK ではないか、
ACTION_PICKを処理できるアプリがインストールされていないか
だと思います。

行いたい処理に対応する Intent は ACTION_PICK
で正しいのですか?
AndFTPでファイルを送信したときに Intent を呼んでいるならば
logcat にでるはずです。それが ACTION_PICK だったという
ことでOKですか?


2010年4月9日16:53 ISAMU TAKATA <isamu...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages