私のAndroidデバイスがカメラから撮った画像を保存するディレクトリを見つける方法についてのガイドラインを教えてください。
次のコード スニペットでは、カメラ アプリを起動する前にファイルのリストを取得するつもりです。カメラ アプリから戻るときに、同じディレクトリ内のすべてのファイルのリストを取得し、新しく追加されたファイルを処理します。
public void onBtnTakePhoto(final View view) {
existingfiles = UploadImageService.getFiles(<IMAGE_LOCATION>);
final Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
startActivityForResult(intent, TAKE_PICTURE);
}
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case TAKE_PICTURE:
List<String> newFies = UploadImageService.getFiles(<IMAGE_LOCATION>);
newFies.removeAll(existingfiles);
for (String newFile : newFies) {
File file = new File(newFile);
addImage( Uri.fromFile(file), PictureSource.CAMERA);
}
break;
}
// regardless of which activity, check that files exist:
verifyFilesExist(images);
}