private async void UploadImage(Android.Net.Uri data)
        {
            var imageNameField = this.FindViewById <EditText>(Resource.Id.field_media_item_name);
            var imagePathField = this.FindViewById <EditText>(Resource.Id.field_media_item_path);

            var imageName = imageNameField.Text;
            var imagePath = imagePathField.Text;

            if (string.IsNullOrWhiteSpace(imageName))
            {
                Toast.MakeText(this, "Please select image name before upload", ToastLength.Long).Show();
                return;
            }

            if (data == null)
            {
                Toast.MakeText(this, "Please select image before upload", ToastLength.Long).Show();
                return;
            }

            try
            {
                this.SetProgressBarIndeterminateVisibility(true);

                using (ISitecoreWebApiSession session = Prefs.From(this).Session)
                {
                    using (Stream stream = ContentResolver.OpenInputStream(this.imageUri))
                    {
                        var builder = ItemWebApiRequestBuilder.UploadResourceRequestWithParentPath(imagePath)
                                      .ItemDataStream(stream)
                                      .ContentType("image/jpg")
                                      .ItemName(imageName)
                                      .FileName("bugaga.jpg");

                        var response = await session.UploadMediaResourceAsync(builder.Build());

                        if (response != null && response.ResultCount > 0)
                        {
                            DialogHelper.ShowSimpleDialog(this, "Image uploaded", "Image path : " + response[0].Path);
                        }
                        else
                        {
                            var title = this.GetString(Resource.String.text_error);
                            DialogHelper.ShowSimpleDialog(this, title, "Failed to upload image");
                        }
                    }
                }
                this.SetProgressBarIndeterminateVisibility(false);
            }
            catch (System.Exception exception)
            {
                this.SetProgressBarIndeterminateVisibility(false);

                var title = this.GetString(Resource.String.text_error);
                DialogHelper.ShowSimpleDialog(this, title, exception.Message);
            }
        }
        private async void SendImage(UIImage image)
        {
            try
            {
                using (ISitecoreWebApiSession session = this.instanceSettings.GetSession())
                {
                    Stream stream = image.AsJPEG().AsStream();

                    var request = ItemWebApiRequestBuilder.UploadResourceRequestWithParentPath(itemPathTextField.Text)
                                  .ItemDataStream(stream)
                                  .ContentType("image/jpg")
                                  .ItemName(this.itemNameTextField.Text)
                                  .FileName("imageFile.jpg")
                                  .Build();

                    this.ShowLoader();

                    var response = await session.UploadMediaResourceAsync(request);

                    if (response != null)
                    {
                        AlertHelper.ShowAlertWithOkOption("upload image result", "The image uploaded successfuly");
                    }
                    else
                    {
                        AlertHelper.ShowAlertWithOkOption("upload image result", "something wrong");
                    }
                }
            }
            catch (Exception e)
            {
                AlertHelper.ShowLocalizedAlertWithOkOption("Error", e.Message);
            }
            finally
            {
                BeginInvokeOnMainThread(delegate
                {
                    this.HideLoader();
                });
            }
        }