xamarin v.now

Download Xamarin v.Now

If you can't read please download the document

Upload: craig-dunn

Post on 07-May-2015

2.483 views

Category:

Technology


1 download

DESCRIPTION

Presentation to Xamarin User Group in San Francisco, 19-Sep-2013... all the latest in Xamarin technology including iOS, Android, Xamarin Studio, Portable Class Libraries, Async/Await and TestCloud.

TRANSCRIPT

  • 1.Craig Dunn Developer Evangelist Xamarin [email protected] @conceptdev v.Now The future is now :)

2. Agenda About Xamarin Xamarin 2.0 v.Now C# 5 - async await iOS UI Designer iOS 7 Google Play Services for Android Test Cloud 3. About Xamarin Apps are native, performance is native Entire platform SDK available to your code: - iOS: StoreKit, EventKit, iCloud, etc - Android: Play Services, Compatibility Library, etc Share C# across Xamarin, Windows & WinPhone apps Leverage platform-specific libraries: iOS: Objective-C Android: Java user experience performance features 4. About Xamarin Mono C# + .NET implementation for Linux started in 2001/released 2004 MonoTouch (for iOS) - 2009 Mono for Android - 2011 MonoDevelop IDE MonoMac open source project iPhoneOS 3.0, pre-iPad Android 2.3 Gingerbread C# 1.0 5. About Xamarin Mono C# + .NET implementation for Linux started in 2001/released 2004 MonoTouch (for iOS) - 2009 Mono for Android - 2011 MonoDevelop IDE MonoMac open source project Mono 3.2 .NET 4.5 C# 5 iOS 7 Android 4.3 Jelly Bean 6. Xamarin 2.0 Xamarin Studio Xamarin.iOS Visual Studio Xamarin.Android Component Store Free Starter Edition http://xamarin.com/guide/ http://blog.xamarin.com/announcing-xamarin-2.0/ 7. How Does it Work? Windows C# Xaml C# Network,Storage, BusinessLogic UI wire -up logic run/me pla2orm .NET UI yourcode 8. How Does it Work? Mono.NETRunBme WindowsPhoneAndroid iOS WindowsMac SharedCode(C#) .NET XamlAndroidXml Storyboards XIB Xamarin.Android Xamarin.iOS Xamarin.Mac C# C# C# C# Xaml C# H7pClient&WebServicesSQLite.NET&databaseIOmore... UI wire -up logic run/me pla2orm UIUIUIUIUI yourcode 9. Mac OS X WindowsWindows IDE iOS Android Mac Windows/Phone Xamarin Development Environments Xamarin Business Edition+ Mac + 10. Mac OS XWindows Visual Studio Xamarin Build Host Xamarin.iOS for Visual Studio plug-in Build Host conguration iOS Projects iOS Property Pages iOS build, deploy, debug iOS Output panes Device iOS Simulator Apple iOS SDK Xcode Interface Builder Compiler Keychain Certications Provisioning Proles Network access iOS apps in Visual Studio?! 11. Xamarin Development Environments Coding Auto-complete Refactoring User Interface Design GUI tools Debugging Build & Deploy Simulators & Devices Testing & Production/App Stores 12. IOS C# on iPhone, iPad and iPod touch 13. iOS Development Environment Xamarin Studio Visual Studio 14. iOS UI Designer Xcode - now Xamarin Designer - beta 15. iOS Development Environment Code signing App configuration Deployment Keychain - certificates 16. iOS Development Environment Code signing App configuration Deployment Provisioning Portal http://developer.apple.com 17. iOS Development Environment Code signing App configuration Deployment 18. DEMO iOS 19. ANDROID C# on Android (Google Play, Kindle, ...) 20. Android Development Environment Xamarin Studio Visual Studio 21. Android UI Designer Xamarin Studio Visual Studio 22. Android Development Environment Shared runtime for debugging only. Linking reduces size Choose CPU arch 23. Android Development Environment AndroidManifest.xml Permissions App configuration use [Activity] and other attributes 24. Android Development Environment Deployment Signing wizard 25. DEMO Android 26. CROSS PLATFORM Portable code... 27. What is a Portable Class Library? Subset of .NET that is supported across the set of target platforms. Starting with File > New App gives you platform- specific code, eg. Windows Store 28. What is a Portable Class Library? Subset of .NET that is supported across the set of target platforms. Some Microso! platforms (eg. Windows Phone) are more restricted than Xamarin. 29. What is a Portable Class Library? Subset of .NET that is supported across the set of target platforms. Some Microso! platforms (eg. Windows Phone) are more restricted than Xamarin. but no dynamic (AOT) 30. What is a Portable Class Library? Profile1 NetForWSA, Net4, SL4, WP7, XBox360 31. What is a Portable Class Library? Profile2 NetForWSA, Net4, SL4, WP7 32. What is a Portable Class Library? Profile104 NetForWSA, Net45, SL4, WP75 33. PCL Example Tasky Portable XML An abstract implementation of a data storage class, with implementation for each platform Profile 158 34. PCL Example The Portable Class Library is compiled in a way that is sharable. We create a Provider for each platform 35. DEMO Tasky Portable 36. ASYNC AWAIT C# 5 tailor-made for mobile! 37. Mobile Apps Need responsive user interfaces App features are o!en dependent on: network access database functionality or I/O complex processing on mobile CPUs stu that takes some time You want to run these on a dierent thread to keep the UI responsive... they should be ASYNCHRONOUS! Fast! Long running tasks! Threads! All 38. DEMO Async Await 39. Old-style callbacks 1) Download Html string 2) Download Jpeg image 3) Save to Photo Album 5) Error Handling 4) Return Html length 6) InvokeOnMainThread Callback Hell 40. Callback Hell Old-style callbacks 1) Download Html string 2) Download Jpeg image 3) Save to Photo Album 5) Error Handling 4) Return Html length 6) InvokeOnMainThread 41. Old-style callbacks Spaghetti code: Callbacks are the new GOTO Control flow jumps around in ways that are diicult to read & understand from the source Error handling is diicult to implement, required in many dierent places Changes in the chain can have unintended consequences http://tirania.org/blog/archive/2013/Aug-15.html 42. 1) Download Html string 2) Download Jpeg image 3) Save to Photo Album 5) Error Handling 4) Return Html length Comparison Async-ified 6) InvokeOnMainThread 43. 1) Download Html string 2) Download Jpeg image 3) Save to Photo Album 5) Error Handling 4) Return Html length Comparison 6) InvokeOnMainThread one place not required Async-ified 44. Comparison 1) Download Html string 2) Download Jpeg image 3) Save to Photo Album 5) Error Handling 4) Return Html length 6) InvokeOnMainThread old new! 45. DEMO Tasky Parse 46. TEST CLOUD Scalable, repeatable real device testing 47. Test Cloud 48. Test Cloud 49. Test Cloud 50. Test Cloud 51. RECAP 52. Recap Build iOS & Android apps in C# with .NET Latest language features Use Xamarin Studio or Visual Studio Apps are native, with native performance Share C# code Latest C# 5 features Component Store http://components.xamarin.com Test Cloud http://testcloud.xamarin.com 53. Questions? Developer Evangelist Xamarin [email protected] @conceptdev Craig Dunn Documentation http://docs.xamarin.com/ Samples http://github.com/xamarin http://xamarin.com/download