
Xamarin Mobile Development This webinar will provide an overview of products and services offered by Xamarin that can be used to deliver rich cross-platform mobile apps for Android and iOS using C# and .NET. Topics: • Xamarin Platform • Xamarin Test Cloud • Xamarin Insights ©WebAgeSolutions.com 1 Mark Reynolds • Software consultant with more than 30 years of experience. • Worked with the Xamarin Platform for the last 4 years • Authored 2 books on Xamarin development • Worked on the Cinemark app, a 2014 Xammy Award finalist and still featured on the Xamarin website https://xamarin.com/customers/media ©WebAgeSolutions.com 2 Xamarin Books Xamarin Mobile Application Development for Android Learn to develop full featured Android apps using your existing C# skills with Xamarin.Android Xamarin Essentials Learn how to efficiently develop Android and iOS apps and share code using the Xamarin platform ©WebAgeSolutions.com 3 Xamarin Product Offerings Xamarin Platform Xamarin.Android, Xamarin.iOS, Xamarin.Mac, Xamarin.Forms Xamarin Test Cloud Cloud based automated mobile testing platform Xamarin Insights Analytics platform for Xamarin apps ©WebAgeSolutions.com 4 Xamarin Platform The Xamarin Platform is a suite of tools that allow C# .NET developers to build apps for Android, iOS, OSX, and Windows with the ability to share code across all of these platforms. Xamarin.Android Xamarin Studio Xamarin.iOS Xamarin for Visual Studio Xamarin.Mac Xamarin.Forms ©WebAgeSolutions.com 5 Xamarin Platform Value • Allows C# developers to leverage their existing skills • Allows a significant amount of code to be shared across Android and iOS apps as well as other .NET platforms • Allows developers to utilize the full power or C# and .NET ©WebAgeSolutions.com 6 Xamarin Studio • Full-Featured IDE that runs on OSX and Windows • Provides modern features like code complete, refactoring, and code navigation • Integrates with Git and Subversion for source control • Allows development of Android, iOS, and Mac apps from a single IDE ©WebAgeSolutions.com 7 Xamarin for Visual Studio • Allows developers to use one of the worlds most popular development environments for Android and iOS development. • Supports full Android development cycle. • Supports editing of code, storyboards, and xibs for iOS development. Requires access to a Mac on the same network to compile app and to run apps in the simulator. ©WebAgeSolutions.com 8 Mono and Xamarin Mono is an open source cross-platform implementation of the .NET platform that includes a CLR that is binary compatible with Microsoft .NET, a set of compilers for languages such as C#, and an implementation of the .NET runtime libraries. • Xamarin products were originally based exclusively on Mono; first with the introduction of MonoTouch (Xamarin.iOS) and then Mono for Android (Xamarin.Android). • In 2014, Microsoft open sourced .NET and Xamarin began the transition to using the open source .NET runtime libraries. • Xamarin Studio 6 Preview has support for Rosyln, an open source .NET compiler project started by Microsoft. ©WebAgeSolutions.com 9 Binding Libraries A important part of the Xamarin Platform is the binding libraries. They provide a C# wrapper around Native APIs allowing developers to make API calls from their C# code. • Native APIs (Android, iOS, OSX) are exposed in a way that feels natural to C# developers. For example properties are exposed instead of requiring use of getters and setters and .NET events can be use rather than creating Actions. • Binding libraries APIs match their native APIs almost exactly so C# developers can leverage a vast array of examples and documentation and easily translate them into Xamarin C# solutions. ©WebAgeSolutions.com 10 Xamarin.Android apps • Xamarin.Android apps run as both Java (Art/Dalvik) apps and managed C# apps. • This is accomplished by the use of the Java Native Interface (JNI) to facilitate calls between Android SDK classes and Xamarin.Android binding classes as well as the use of a technique called Pier Objects. • These topics are both discussed in more detail in my books. ©WebAgeSolutions.com 11 Xamarin.Android app Demo • Project Structure • Xamarin.Android Designer • Project Options • Manifest Editor • Run app ©WebAgeSolutions.com 12 Xamarin.iOS apps • Xamarin.iOS apps are statically compiled using the Mono Ahead-of- Time (AOT) compilation facilities. • AOT is used to comply with Apple’s requirement to reframe from using Just-in-Time compilation facilities or running in a virtual machine. • Use of AOT comes with a few small restrictions on use of C# and .NET features which rely on JIT. ©WebAgeSolutions.com 13 Xamarin.iOS app Demo • Project Structure • Xamarin.iOS Designer • Xamarin.iOS / Xcode Interface Builder sync • Code-Behind classes • Run app ©WebAgeSolutions.com 14 Development Approaches A number of different approaches can be employed when developing with the Xamarin Platform depending on how you prioritize code reuse, performance, and native look and feel. • Xamarin Classic Best performance, completely native look and feel (~40-50% reuse*) • Xamarin + MvvmCross Slight performance hit, increased code reuse, completely native look and feel (~80% reuse*) • Xamarin.Forms Slight performance hit, more generic UI, greatly increased code reuse (~95% reuse*) *Code reuse percentages are purely estimates based on experience; your mileage may vary. ©WebAgeSolutions.com 15 Xamarin + MvvmCross MvvmCross is an open source framework that is based on the Model- View-ViewModel (MVVM) design pattern and is designed to enhance code reuse across numerous platforms, including Xamarin.Android, Xamarin.iOS, Windows Phone, Windows Store, WPF, and Mac OS X. The MvvmCross project is hosted on GitHub and can be accessed at https://github.com/MvvmCross/MvvmCross ©WebAgeSolutions.com 16 Views and View Models • MVVM is a variant of the MVC pattern where the View is split into two distinct objects, the View and the ViewModel. • A View is a platform specific set of classes used to render information contained in the ViewModel and accept user interactions which are in turn directed to the ViewModel for processing • A ViewModel is a platform independent class which contains Model information, usually obtained through accessing web services, and Commands which contain application logic triggered by users interacting with a View. ©WebAgeSolutions.com 17 Data binding • Data binding facilitates communication between the View and the ViewModel by establishing a two-way link that allows data to be exchanged. • The data binding capabilities provided by MvvmCross are based on capabilities found in a number of Microsoft XAML-based UI frameworks such as WPF and Silverlight. • The basic idea is that you bind a property in a UI control, such as the Text property of an EditText control in an Android app to a property of a data object housed in the ViewModel. ©WebAgeSolutions.com 18 Xamarin + MvvmCross Demo • Project Structure • Views • View Models • Databinding • User Interaction • Run apps ©WebAgeSolutions.com 19 Xamarin.Forms Xamarin.Forms is a framework that can be used to develop mobile apps for Android, iOS, and Windows Phone as well as Windows Desktop apps. It uses virtually the same code base for each platform while still providing a platform-specific look and feel. ©WebAgeSolutions.com 20 Xamarin.Forms • User interfaces are rendered using native controls for the target platform. The framework provides and abstraction for each type of control as well as a rendered for each platform that can be targeted. • User interfaces can be built in code or declaratively specified using XAML. • Data binding is available and can be specified with a XAML page. ©WebAgeSolutions.com 21 Xamarin.Forms Xamarin.Forms is best when: • Apps that do not require a great deal of platform-specific functionality. • Shared code takes priority over a custom UI. ©WebAgeSolutions.com 22 Xamarin.Forms Demo • Project Structure • Xamarin.Forms XAML • Run apps ©WebAgeSolutions.com 23 Additional Apps to Review While the apps that have demonstrated during this webinar have been very simple, the Xamarin website contains a listing of many apps that demonstrate the full power of the platform. https://xamarin.com/customers ©WebAgeSolutions.com 24 Xamarin Platform Pricing Indie Business Enterprise $25 / month (paid monthly or annually only $999 / year $1,899 / year for companies <= 5 employees) 1 developer for 1 platform 1 developer for 1 platform 1 developer for 1 platform Unlimited app size Indie + Business + Use of Xamarin Studio Visual Studio Plugin 1 business day SLA Use of Xamarin.Forms Email Support Hotfixes Use of Xamarin Test Cloud Account Manager Forum Support The table above only contains summary information and may not be current. See https://store.xamarin.com for complete details. ©WebAgeSolutions.com 25 Xamarin Test Cloud Xamarin Test Cloud is a cloud base testing service that allows Android and iOS apps to be tested on thousands of different physical devices. • Xamarin and non-Xamarin apps can be tested on Test Cloud. • Tests can be developed in C# or Ruby. • Tests can be developed using Xamarin Studio or Visual Studio. • Tests can be developed and debugged using locally connected devices. • Significant portions, if not all, of the code for a Test can be shared between Android and iOS. ©WebAgeSolutions.com 26 Xamarin Test Cloud Value • Allows apps to be testing on thousands of physical devices running various versions of iOS and Android. • Allows for the development of automated regression test suites. ©WebAgeSolutions.com
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages35 Page
-
File Size-