Developing Cross-Platform Apps with C# using Xamarin
C# is one of the most popular development languages in the world but we write the majority of mobile apps in Java, Swift or Objective-C. While it was originally possible to build .NET apps running on Windows-based devices only, the game has changed. Dramatically.
Using Xamarin, we can now write apps, which run on Android and iOS devices natively using C#. This way, C# allows us to target billions of extra devices using the language we all love. The experiences, which users get from Xamarin-base apps, are fully native: the apps aren't web-based, trimmed-down versions of the apps. Instead, they offer the full functionality of the platform they target.
The impact in terms of re-using code is huge. We can build architecture with this cross-platform functionality in mind and construct it so that a lot (or maybe we should say: most) of our code can be re-used in Windows Phone, iOS and Android apps.
In this course, you'll learn about the Xamarin environment. You'll learn about cross-platform development, Xamarin.Android and Xamarin.iOS. All this becomes possible using the knowledge you already have: C#!
Students should have experience developing applications or websites using C#; the course assumes you are familiar with the C# language. XAML knowledge is a plus but is not required.
Please note: Due to the nature of the delegate labs on this course it can only run on Apple Macs. The course cannot be delivered on Windows based machines. This is not a requirement for delegates completing the course as Attend From Anywhere.
Chapter 1: C# Review
To start we review some of the key features of the C# language that you will need to understand and exploit when developing effective Xamarin apps.
- Value and Reference Types under the hood
- Classes, Encapsulation and Properties
- Inheritance and Polymorphism
- Interfaces and Decoupling
- Dependency Injection
- Inversion of Control
- Anonymous Delegates and Lambdas
- Tasks and async
- Useful Design Patterns
Chapter 2: Xamarin Introduction
Next we set the scene by introducing Xamarin and discuss where it fits in and how it can be best used. We look at some of the mobile development challenges and then begin to take a look at the mighty tool itself.
- What is Xamarin
- Bit of History
- Benefits and Disadvantages of using Xamarin
- Mobile Development Challenges
- Where does it fit in?
- How does it work?
- What you need to get started
- Getting started with Xamarin Studio
Chapter 3: Getting Started with Xamarin.android
In Chapter 3 we are straight into the fundamentals of android app development and look at creating projects, setting correct API versions and working with resources such as layouts and images. After reviewing android App architecture we then create our first activity and soon create a multi activity app with Intents. By the end you have your first android app.
- android Projects
- API Versions
- Resources and Images
- App Architecture
- Creating Activities
- Accessing Views
- Working with Intents
- Launching Activities
- Passing data between activities
- Working with an activities lifecycle
Chapter 4: Designing your android UI with Layouts
Laying out your activities is an essential part of designing an app. That's why we take some time to explore the various options available that enable you to create an adaptable layout. We also take a look at some of the widely used UI views available out of the box.
- Creating the UI with the Designer
- Designing Layouts and working with
- Grid layouts
- Working with some of the built in views including
- Date and time picker
- Standard Views
Chapter 5: Lists, Tabs and Fragments in android
Displaying lists of information is an essential part of any app so we spend some time exploring how we can present standard and custom lists of data to users. We also look at how we can present a Tabbed interface and introduce the concept of reusable fragments.
- ListViews and ListAdapters
- Custom ListAdapters
- Built in and Custom Row Layouts
- Working with Fragments
- Using fragments declaratively and programmatically
- The FragmentManager
- Fragment Lifecycle
- State Management
- Tabs and the Action Bar
Chapter 6: Additional android Issues
To finish off android development we look at some additional issues that you need to be aware off.
- Activity Lifecycle
- State Management
- Rotation and managing alternate layouts
- Drawables and resolution
Chapter 7: Cross Platform Code Sharing
The big win with Xamarin is code reuse across platforms. The more reuse the greater the benefit. We will look at how this can be achieved.
- Why Code Share
- Code sharing Options
- Shared Projects
- Portable Class Libraries
- Ramping up code reuse across platforms
- Cross Platform Data Access
- Abstracting device specificity
- Dependency Injection
- Inversion of Control Containers
- MVVM Pattern
- MVVM Light
Chapter 8: Getting Started With iOS Development in Xamarin
In this chapter you will use the same C# language to write an iOS app. We will find out about designing our app with a storyboard and then hook it up to code in the form of a View Controller. In no time we are creating multi scene applications and are segueing between them.
- iOS Development in Xamarin
- Solutions, Projects and Files
- Intro to Storyboards, Scenes and Segues
- MVC and View Controllers
- Linking Scenes to View Controllers
- Working with Multiple View Controllers
- Modal Display
- Navigation Controllers
- Transferring Data between Scenes
- Loading Storyboards from Code
Chapter 9: Designing an iOS Layout
In Chapter 8 we look at how we can design a UI to respond to changes in container size using a combination of Auto Layout and Size Classes. We will also explore some of the UI controls.
- Xamarin iOS Designer Intro
- Designing a View
- Using Auto Layout
- Working with Constraints
- Understanding and Exploiting Size Classes
- iOS UI Controls
- Unwind Segues
Chapter 10: Working with Table Views
The workhorse of any app is the table view. We use it to display data and even to layout our data entry forms. In this chapter we will explore the table view. We will also look at a related view called the Collection view.
- Table Views
- Types of Table View
- Building a Table View
- Static Table Views
- Dynamic Table Views
- Table View Controllers
- Table View Cells
- Headers and Footers
- Editing Cells
- Collection Views
Chapter 11: Controlling iOS Navigation and Storage
We finish off our look as iOS development in Xamarin by covering iOS navigation and looking at how we can store basic data.
- Manual Storyboards
- Navigation Controllers
- Tab Bar Controllers
- Modal View Controllers
- Split View Controllers
- Settings and plists
- Working with files
- User Defaults Database
Chapter 12: App Deployment for android and iOS
So your app is complete and ready to be deployed. So how do you do that? We will look at the issues involved in deploying your app to the relevant app stores.
- Preparing and app for deployment
- Deploying to the app store
Chapter 13: Xamarin.Forms
Having spent most of the course writing separate apps for android and iOS we now look to Xamarin forms to unify our development process. 'Write once run everywhere' is the pitch but can we really write one set of UI code and run it on android, iOS and Windows phone. In this chapter we will find out.
- What are Xamarin Forms
- Getting started with…
- How it works
- Basic elements
- Sizing and Positioning
- Hooking up to Code
Chapter 14: Forms, ListViews and Data Binding with Xamarin.Forms
We look a little more closely at writing forms and lists and introduce data binding with XAML.
- Data Binding Overview
- Page Binding
- Change Notification
- Field Binding
- Field to Field Binding
- Displaying Lists with the ListView
- Making life easier with Resources and Styles
Frequently asked questionsSee all of our FAQs
How can I create an account on myQA.com?
There are a number of ways to create an account. If you are a self-funder, simply select the "Create account" option on the login page.
If you have been booked onto a course by your company, you will receive a confirmation email. From this email, select "Sign into myQA" and you will be taken to the "Create account" page. Complete all of the details and select "Create account".
If you have the booking number you can also go here and select the "I have a booking number" option. Enter the booking reference and your surname. If the details match, you will be taken to the "Create account" page from where you can enter your details and confirm your account.
Find more answers to frequently asked questions in our FAQs: Bookings & Cancellations page.
How do QA’s virtual classroom courses work?
Our virtual classroom courses allow you to access award-winning classroom training, without leaving your home or office. Our learning professionals are specially trained on how to interact with remote attendees and our remote labs ensure all participants can take part in hands-on exercises wherever they are.
We use the WebEx video conferencing platform by Cisco. Before you book, check that you meet the WebEx system requirements and run a test meeting (more details in the link below) to ensure the software is compatible with your firewall settings. If it doesn’t work, try adjusting your settings or contact your IT department about permitting the website.
Learn more about our Virtual Classrooms.
How do QA’s online courses work?
QA online courses, also commonly known as distance learning courses or elearning courses, take the form of interactive software designed for individual learning, but you will also have access to full support from our subject-matter experts for the duration of your course. When you book a QA online learning course you will receive immediate access to it through our e-learning platform and you can start to learn straight away, from any compatible device. Access to the online learning platform is valid for one year from the booking date.
All courses are built around case studies and presented in an engaging format, which includes storytelling elements, video, audio and humour. Every case study is supported by sample documents and a collection of Knowledge Nuggets that provide more in-depth detail on the wider processes.
Learn more about QA’s online courses.
When will I receive my joining instructions?
Joining instructions for QA courses are sent two weeks prior to the course start date, or immediately if the booking is confirmed within this timeframe. For course bookings made via QA but delivered by a third-party supplier, joining instructions are sent to attendees prior to the training course, but timescales vary depending on each supplier’s terms. Read more FAQs.
When will I receive my certificate?
Certificates of Achievement are issued at the end the course, either as a hard copy or via email. Read more here.