maximizing code-sharing with xamarin.mobile, james clancey
TRANSCRIPT
Xamarin.Mobile.Geolocation
• Geolocator• Position
LatitudeLongitudeAccuracyAltitudeAltitude AccuracySpeedHeading
Xamarin.Mobile.Contacts
• AddressBookRequestPermision
• ContactPhoneEmailAddressWebsiteRelationship
Xamarin.Mobile.Media
• PhotosPick existingTake new photo
• VideoPick existingTake new video
Code sharing
• Xamarin.Mobile lets you maximize Code Sharing• How can you apply this to your own apps?
DEMO
Xamarin.Mobile Api
• We take care of all the UI for you• Perfect for most use cases• Sometimes you need more control
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
New API iOSvar picker = new MediaPicker();
MediaPickerController controller = picker.GetTakePhotoUI (new StoreCameraMediaOptions {! Name = "test.jpg",! Directory = "MediaPickerSample"} );
PresentViewController (controller, true, null);
controller.GetResultAsync().ContinueWith (t => {! // Dismiss the UI yourself! controller.DismissViewController (true, () => {! ! MediaFile file = t.Result;! } );!}, TaskScheduler.FromCurrentSynchronizationContext());
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
New API Androidvar picker = new MediaPicker (this);
if (!picker.IsCameraAvailable)! Console.WriteLine ("No camera!");else {! var intent = picker.GetTakePhotoUI (new StoreCameraMediaOptions {! ! Name = "test.jpg",! ! Directory = "MediaPickerSample"! } );! StartActivityForResult (intent, 1);}
Q&A
THANK YOU