Xamarin.Forms Projects
eBook - ePub

Xamarin.Forms Projects

Build multiplatform mobile apps and a game from scratch using C# and Visual Studio 2019, 2nd Edition

  1. 504 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Xamarin.Forms Projects

Build multiplatform mobile apps and a game from scratch using C# and Visual Studio 2019, 2nd Edition

About this book

Learn to build cross-platform mobile apps using the latest features in Xamarin.Forms 4 with the help of a series of projects including apps for real-time chatting, AR games, location-tracking, weather, photo galleries, and much more

Key Features

  • Develop mobile apps, AR games, and chatbots of varying complexity with the help of real-world examples
  • Explore the important features of Xamarin.Forms 4 such as Shell, CollectionView, and CarouselView
  • Get to grips with advanced concepts such as AR and VR and machine learning for mobile development

Book Description

Xamarin.Forms is a lightweight cross-platform development toolkit for building apps with a rich user interface. Improved and updated to cover the latest features of Xamarin.Forms, this second edition covers CollectionView and Shell, along with interesting concepts such as augmented reality (AR) and machine learning.

Starting with an introduction to Xamarin and how it works, this book shares tips for choosing the type of development environment you should strive for when planning cross-platform mobile apps. You'll build your first Xamarin.Forms app and learn how to use Shell to implement the app architecture. The book gradually increases the level of complexity of the projects, guiding you through creating apps ranging from a location tracker and weather map to an AR game and face recognition. As you advance, the book will take you through modern mobile development frameworks such as SQLite, .NET Core Mono, ARKit, and ARCore. You'll be able to customize your apps for both Android and iOS platforms to achieve native-like performance and speed. The book is filled with engaging examples, so you can grasp essential concepts by writing code instead of reading through endless theory.

By the end of this book, you'll be ready to develop your own native apps with Xamarin.Forms and its associated technologies, such as.NET Core, Visual Studio 2019, and C#.

What you will learn

  • Set up Xamarin.Forms to build native apps with code-sharing capabilities
  • Understand the core aspects of developing a mobile app, such as its layout, UX, and rendering
  • Use custom renderers to gain platform-specific access
  • Discover how to create custom layouts for your apps with Xamarin.Forms Shell
  • Use Azure SignalR to implement serverless services in your Xamarin apps
  • Create an augmented reality (AR) game for Android and iOS using ARCore and ARKit, respectively
  • Build and train machine learning models using CoreML, TensorFlow, and Azure Cognitive Services

Who this book is for

This book is for C# and.NET developers who want to learn Xamarin.Forms and get started with native Xamarin mobile application development from the ground up. Working knowledge of Visual Studio will help you to get the most out of this book.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Xamarin.Forms Projects by Daniel Hindrikes,Johan Karlsson in PDF and/or ePUB format, as well as other popular books in Computer Science & Microsoft Programming. We have over one million books available in our catalogue for you to explore.

Information

Building a Weather App for Multiple Form Factors
Xamarin.Forms isn't just for creating apps for phones; it can also be used to create apps for tablets and desktop computers. In this chapter, we will build an app that will work on all of these platforms. As well as using three different form factors, we are also going to be working on three different operating systems: iOS, Android, and Windows.
The following topics will be covered in this chapter:
  • How to use FlexLayout in Xamarin.Forms
  • How to use VisualStateManager
  • How to use different views for different form factors
  • How to use behaviors
Let's get started!

Technical requirements

To work on this project, we need to have Visual Studio for Mac or PC installed, as well as the Xamarin components. See Chapter 1, Introduction to Xamarin, for more details on how to set up your environment. To build an iOS app using Visual Studio for PC, you have to have a Mac connected. If you don't have access to a Mac at all, you can choose to just work on the Windows and Android parts of this project. Similarly, if you only have Windows, you can choose to work on only the iOS and Android parts of this project.

Project overview

Applications for iOS and Android can run on both phones and tablets. Often, apps are just optimized for phones. In this chapter, we will build an app that will work on different form factors, but we aren't going to stick to just phones and tablets – we are going to target desktop computers as well. The desktop version will be for the Universal Windows Platform (UWP).
The app that we are going to build is a weather app that displays the weather forecast based on the location of the user.

Building the weather app

It's time to start building the app. Create a new blank Xamarin.Forms app using .NET Standard as the Code Sharing Strategy and select iOS, Android, and Windows (UWP) as the platforms. We will name the project Weather.
As the data source for this app, we will use an external weather API. This project will use OpenWeatherMap, a service that offers a couple of free APIs. You can find this service at https://openweathermap.org/api. We will use the 5 day / 3 hour forecast service in this project, which provides a 5-day forecast in...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Foreword
  6. Contributors
  7. Preface
  8. Introduction to Xamarin
  9. Building Our First Xamarin.Forms App
  10. Building a News App Using Xamarin.Forms Shell
  11. A Matchmaking App with a Rich UX Using Animations
  12. Building a Photo Gallery App Using CollectionView and CarouselView
  13. Building a Location Tracking App Using GPS and Maps
  14. Building a Weather App for Multiple Form Factors
  15. Setting Up a Backend for a Chat App Using Azure Services
  16. Building a Real-Time Chat Application
  17. Creating an Augmented Reality Game
  18. Hot Dog or Not Hot Dog Using Machine Learning
  19. Other Books You May Enjoy