I\'m trying to find a way to access full resolution pictures from MonoDroid, after a long time of attempting to port the Java examples to MonoDroid and looking at how for ot
I'll simply posted the code that i have used in my project. Hope it will help you. I have also tried to set file name and path through ContentValues class, like it is described in Android wiki, but all was ineffectively, I think that it's some MonoDroid bug.
private string _imageUri;
private Boolean isMounted
{
get
{
return Android.OS.Environment.ExternalStorageState.Equals(Android.OS.Environment.MediaMounted);
}
}
public void BtnCameraClick(object sender, EventArgs eventArgs)
{
var uri = ContentResolver.Insert(isMounted ? MediaStore.Images.Media.ExternalContentUri
: MediaStore.Images.Media.InternalContentUri, new ContentValues());
_imageUri = uri.ToString();
var i = new Intent(MediaStore.ActionImageCapture);
i.PutExtra(MediaStore.ExtraOutput, uri);
StartActivityForResult(i, CAPTURE_PHOTO);
}
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
if (resultCode == Result.Ok && requestCode == CAPTURE_PHOTO)
{
Toast.MakeText(this, string.Format("Image URI is {0}",_imageUri), ToastLength.Short).Show();
}
}