Book description
Learn how to build stunning, maintainable, cross-platform mobile application user interfaces using C# 7 with the power of both the Xamarin and Xamarin.Forms frameworks.
Key Features
- Build effective native and cross-platform user interfaces using the Xamarin frameworks for iOS and Android, as well as Xamarin.Forms.
- Maximize the testability, flexibility, and overall quality of your Xamarin mobile apps.
- Step-by-Steps guide that is packed with real-world scenarios and solutions, to build professional grade mobile apps and games for the iOS and Android platforms, using C# 7.
Book Description
This book will provide you with the knowledge and practical skills that are required to develop real-world Xamarin and Xamarin.Forms applications. You'll learn how to create native Android app that will interact with the device camera and photo gallery, and then create a native iOS sliding tiles game. You will learn how to implement complex UI layouts and creating customizable control elements based on the platform, using XAML and C# 7 code to interact with control elements within your XAML ContentPages.
You'll learn how to add location-based features by to your apps by creating a LocationService class and using the Xam.Plugin.Geolocator cross-platform library, that will be used to obtain the current device location. Next, you'll learn how to work with and implement animations and visual effects within your UI using the PlatformEffects API, using C# code.
At the end of this book, you'll learn how to integrate Microsoft Azure App Services and use the Twitter APIs within your app. You will work with the Razor Templating Engine to build a book library HTML5 solution that will use a SQLite.net library to store, update, retrieve, and delete information within a local SQLite database. Finally, you will learn how to write unit tests using the NUnit and UITest frameworks.
What you will learn
- Build native and cross-platform apps for both iOS and Android using the Xamarin and Xamarin.Forms platform using C# 7.
- Implement and customize different user-interface layouts and Animations within your application and use the PlatFormEffects API to change appearance of control elements.
- Understand the MVVM architectural pattern and how to implement this with your apps.
- Build a NavigationService class to enable. navigation between your ViewModels as well as Implementing Data-Binding to control elements within your XAML pages and ViewModels.
- Work with the Razor Templating Engine to create Models and Razor Pages that communicate with an SQLite database.
- Build a LocationService class to incorporate location-based features within your cross-platform apps to display the user's current location by creating a custom cross-platform map control and handle location tracking updates.
- Work with the Microsoft Azure App Services Platform and Implement Social networking features within your app using the Twitter API.
- Unit Testing your Xamarin.Forms apps using the NUnit and UITest Frameworks
Who this book is for
This book is intended for readers who have experience using at least the C# 6.0 programming language and interested in learning how to create stunning native, and cross-platform user interfaces for the iOS and Android platforms using the Xamarin and Xamarin.Forms frameworks using C# 7.
Table of contents
- Title Page
- Copyright and Credits
- Dedication
- www.PacktPub.com
- Contributors
- Acknowledgments
- Preface
- Setting Up Visual Studio for Mac
- Building a PhotoLibrary App Using Android
-
Building a SlidingTiles Game Using Xamarin.iOS
- Creating a native iOS app using Visual Studio for Mac
- Creating the SlidingTiles user interface using Storyboards
-
Implementing the game logic for our SlidingTiles Game
- Creating and implementing the GameTile Interface class
- Creating and implementing the GameTile class
- Updating the ViewController class to implement our class methods
- Creating and implementing the CreateGameBoard method
- Creating and implementing the ResetGame_Clicked method
- Randomly shuffling our Game Tiles on the Game Board
- Implementing the StartNewGame Instance method
- Handling touch events in the Game Board user interface
- Working with and applying animations to your app
- Launching the SlidingTiles game using the iOS simulator
- Summary
-
Creating the TrackMyWalks Native App
- Creating the TrackMyWalks project solution
- Creating and implementing our data model
- Creating the WalksMainPage interface using XAML
- Implementing the WalksMainPage code using C#
- Creating the WalkEntryPage interface using XAML
- Implementing the WalkEntryPage code using C#
- Creating the WalkTrailInfoPage interface using XAML
- Implementing the WalkTrailInfoPage code using C#
- Creating the WalkDistancePage interface using XAML
- Implementing the WalkDistancePage code using C#
- Updating the TrackMyWalks.iOS AppDelegate
- Updating the TrackMyWalks.Android MainActivity
- Creating the SplashPage interface using XAML
- Implementing the SplashPage code using C#
- Launching TrackMyWalks using the iOS simulator
- Summary
-
MVVM and Data Binding
- Understanding the MVVM architectural pattern
- Creating and implementing the BaseViewModel
- Creating the WalksMainPageViewModel using C#
- Creating the WalkEntryPageViewModel using C#
- Creating the WalkTrailInfoPageViewModel using C#
- Creating the WalkDistancePageViewModel using C#
- Launching the TrackMyWalks app using the iOS simulator
- Summary
-
Navigating Within the Mvvm Model
- Understanding the Xamarin.Forms Navigation API
- Differences between the Navigation and ViewModel approaches
- Creating and implementing the NavigationService interface
- Creating and implementing the NavigationService class
- Updating the BaseViewModel to use the navigation service
- Updating the WalksMainPageViewModel using C#
- Updating the WalksMainPage code-behind using C#
- Updating the WalkEntryPageViewModel using C#
- Updating the WalkEntryPage code-behind using C#
- Updating the WalkTrailInfoPageViewModel using C#
- Updating the WalkTrailInfoPage code-behind using C#
- Updating the WalkDistancePageViewModel using C#
- Updating the WalkDistancePage code-behind using C#
- Updating the SplashPage code-behind using C#
- Updating the App.xaml class to use the navigation service
- Summary
-
Adding Location-based Features Within Your App
- Creating and using platform-specific services within your app
- Creating and implementing the ILocationService interface
- Creating and implementing the LocationService class
- Updating the WalkEntryPageViewModel using C#
- Updating the WalkDistancePageViewModel using C#
- Creating the CustomMapOverlay class using C#
- Updating the WalkDistancePage user interface using XAML
- Updating the WalkDistancePage code-behind using C#
- Creating and implementing the CustomMapRenderer (iOS)
- Creating and implementing the CustomMapRenderer (Android)
- Enabling background location updates and permissions
- Launching the TrackMyWalks app using the iOS simulator
- Summary
-
Customizing the User Interface
- Customizing the DataTemplate in the WalksMainPage
- Applying padding and margins to XAML layouts
- Creating and implementing Styles in your App
-
Creating and using PlatformEffects in your app
- Creating and Implementing the ButtonShadowEffect (iOS)
- Creating and implementing the LabelShadowEffect (iOS)
- Creating and implementing the ButtonShadowEffect (Android)
- Creating and implementing the LabelShadowEffect (Android)
- Implementing the ButtonShadowEffect RoutingEffect class
- Implementing the LabelShadowEffect RoutingEffect class
- Updating the WalksMainPage to use the LabelShadowEffect
- Updating the WalkTrailInfoPage to use the LabelShadowEffect
- Updating the WalkTrailInfoPage to use the ButtonShadowEffect
-
Creating and implementing ValueConverters in your app
- Updating the BaseViewModel class to include additional properties
- Updating the WalksMainPageViewModel to use our property
- Updating the WalksMainPage to use our ImageConverter class
- Updating the WalkEntryPage to use our ImageConverter class
- Updating the WalkTrailInfoPage to use our ImageConverter class
- Launching the TrackMyWalks app using the iOS simulator
- Summary
- Working with Animations in Xamarin.Forms
-
Working with the Razor Templating Engine
- Understanding the Razor templating engine
- Building a BookLibrary app using the Razor templating engine
- Adding the SQLite-net NuGet package to our solution
- Creating and implementing the BookLibraryListing page
- Creating and implementing the BookLibraryAddEdit page
- Updating the Book Library cascading style sheet (CSS)
- Updating the WebViewController class using C#
- Launching the BookLibrary app using the iOS simulator
- Summary
-
Incorporating Microsoft Azure App Services
- Understanding the Microsoft Azure App services platform
- Setting up and configuring Microsoft Azure App services
- Adding the Newtonsoft.Json NuGet package to our solution
- Updating the WalkDataModel for our TrackMyWalks app
- Creating and implementing the RestWebService interface
- Creating and implementing the RestWebService class
- Updating the BaseViewModel class to include our RestWebService
- Updating the WalksMainPage code-behind using C#
- Updating the WalkEntryPage user interface using XAML
- Launching the TrackMyWalks app using the iOS simulator
- Summary
-
Making Our App Social Using the Twitter API
- Creating and registering the TrackMyWalks app with the Twitter Developer Portal
- Creating and implementing the TwitterAuthDetails class
- Creating and implementing the TwitterWebService interface
- Creating and implementing the TwitterWebService class
- Creating and implementing the TwitterSignInPageViewModel using C#
- Creating and implementing the user interface for the TwitterSignInPage
- Creating and implementing the TwitterSignInPageRenderer (iOS)
- Updating the WalksMainPage code-behind using C#
- Updating the WalkDistancePage user unterface using XAML
- Registering the TwitterSignInPage within the App.xaml class
- Launching the TrackMyWalks app using the iOS simulator
- Summary
-
Unit Testing Your Xamarin.Forms Apps
- Creating the Unit Testing project within the TrackMyWalks solution
- Running unit tests within the Visual Studio for Mac IDE
- Creating a UITest project within the TrackMyWalks solution
- Updating the WalksMainPage code-behind using C#
- Adding the Xamarin.Test Cloud.Agent NuGet package
- Running UITests within the Visual Studio for Mac IDE
- Summary
- Other Books You May Enjoy
Product information
- Title: Mastering Xamarin UI Development - Second Edition
- Author(s):
- Release date: August 2018
- Publisher(s): Packt Publishing
- ISBN: 9781788995511
You might also like
book
Xamarin: Cross-Platform Mobile Application Development
Master the skills required to develop cross-platform applications from drawing board to app store(s) using Xamarin …
book
Xamarin Mobile Application Development: Cross-Platform C# and Xamarin.Forms Fundamentals
Xamarin Mobile Application Development is a hands-on Xamarin.Forms primer and a cross-platform reference for building native …
book
Xamarin Mobile Development for Android Cookbook
Over 80 hands-on recipes to unleash full potential for Xamarin in development and monetization of feature-packed, …
book
Xamarin in Action
Xamarin in Action teaches you to build cross-platform mobile apps using Xamarin and C#. You'll explore …