アンドロイドチュートリアルのハックブックからコードを使用しています。壁に画像をアップロードできました。今私が望むのは、カメラから撮った写真をアップロードし、それをグループの特定のアルバムにアップロードすることです。アンドロイド携帯電話のカメラから写真を撮ってFacebookのグループにアップロードする
/*
* Source Tag: upload_photo You can upload a photo from the media
* gallery or from a remote server How to upload photo:
* https://developers.facebook.com/blog/post/498/
*/
case 3: {
if (!Utility.mFacebook.isSessionValid()) {
Util.showAlert(this, "Warning", "You must first log in.");
} else {
dialog = ProgressDialog.show(Hackbook.this, "",
getString(R.string.please_wait), true, true);
new AlertDialog.Builder(this)
.setTitle(R.string.gallery_remote_title)
.setMessage(R.string.gallery_remote_msg)
.setPositiveButton(R.string.gallery_button,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Intent.ACTION_PICK,
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI));
startActivityForResult(intent,
PICK_EXISTING_PHOTO_RESULT_CODE);
}
})
.setNegativeButton(R.string.remote_button,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
/*
* Source tag: upload_photo_tag
*/
Bundle params = new Bundle();
params.putString("url",
"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg");
params.putString("caption",
"FbAPIs Sample App photo upload");
Utility.mAsyncRunner.request("me/photos", params,
"POST", new PhotoUploadListener(), null);
}
}).setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface d) {
dialog.dismiss();
}
}).show();
}
break;
}
は、だから、その上で私を助けることができます:私は変更する必要があるコードの一部は、このだと思う
1)は、それは可能ですか?または、私はまず写真を撮って、どこかに保管してからそれを見つけなければなりません。私はそれを避けたい(私はユーザーから - それがプログラム的に行われ、それからprobができないならば)。 2)変更するにはどのような議論が必要ですか?