Skip to content

Releases: xamarin/Xamarin.Mobile

v0.7.1-preview

13 Dec 18:09
Compare
Choose a tag to compare
v0.7.1-preview Pre-release
Pre-release

Fixes:

  • MediaPicker taking photos should now work correctly on Xperia devices (issue #21).
  • MediaPicker.TakePhoto/Video now appears fullscreen on iPad as per the Apple guidance (issue #19).
  • EXTRA_OUTPUT is now used for taking video as well, avoiding a file move with supporting camera apps (issue #20).

v0.7-preview

07 Oct 16:28
Compare
Choose a tag to compare
v0.7-preview Pre-release
Pre-release

Significant changes

  • New APIs for controlling MediaPicker UI on iOS and Android

iOS:

var picker = new MediaPicker();
MediaPickerController pickerController = picker.GetPickPhotoUI();
myController.PresentViewController (mediaPickerController, true, null);

pickerController.GetResultAsync().ContinueWith (t => {
    // We need to dismiss the controller ourselves
    myController.DismissViewController (true, () => {
        // User canceled or something went wrong
        if (t.IsCanceled || t.IsFaulted)
            return;

        // We get back a MediaFile
        MediaFile media = t.Result;
        ShowPhoto (media);
    });
// Make sure we use the UI thread to show our photo.
}, TaskScheduler.FromCurrentSynchronizationContext());

Android:

void TakePhoto()
{
    var picker = new MediaPicker (this);

    Intent intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions {
        Name = "test.jpg",
        Directory = "MediaPickerSample"
    });

    StartActivityForResult (intent, 1);
}

protected override void OnActivityResult (int requestCode, Result resultCode, Intent data)
{
    // User canceled
    if (resultCode == Result.Canceled)
        return;

    data.GetMediaFileExtraAsync (this).ContinueWith (t => {
        ShowPhoto (t.Result.Path);
    }, TaskScheduler.FromCurrentSynchronizationContext());
}

Given the fragility of the Task<> based API on Android due to Activity lifecycle realities, the async API is now marked [Obsolete] specifically for Android. It will continue to be the only API for Windows Phone and Windows 8 and be present along with the new API for iOS.

Fixes:

  • AddressBook.OrderBy() now returns correctly ordered results on Android
  • Geolocator.GetPositionAsync (CancellationToken) no longer fails on Android
  • Position ctor now copies Altitude property (issue #8).
  • Android's Contact.SaveThumbnailAsync now works properly on non-looper threads (issue #12).