Mobile Development with .NET- Second Edition

Book description

A mobile applications development masterclass for .NET and C# developers

Key Features

  • Uncover the new features and capabilities of the .NET 5 framework in this updated and improved second edition
  • Optimize the time required to develop highly performant cross-platform applications
  • Understand the architectural patterns and best practices for mobile application development

Book Description

Are you a .NET developer who wishes to develop mobile solutions without delving into the complexities of a mobile development platform? If so, this book is a perfect solution to help you build professional mobile apps without leaving the .NET ecosystem.

Mobile Development with .NET will show you how to design, architect, and develop robust mobile applications for multiple platforms, including iOS, Android, and UWP using Xamarin, .NET Core, and Azure.

With the help of real-world scenarios, you'll explore different phases of application development using Xamarin, from environment setup, design, and architecture to publishing. Throughout the book, you'll learn how to develop mobile apps using Xamarin and .NET Standard. You'll even be able to implement a web-based backend composed of microservices with .NET Core using various Azure services including, but not limited to, Azure Active Directory, Azure Functions. As you advance, you'll create data stores using popular database technologies such as Cosmos DB and data models such as the relational model and NoSQL.

By the end of this mobile application development book, you'll be able to create cross-platform mobile applications that can be deployed as cloud-based PaaS and SaaS.

What you will learn

  • Discover the latest features of .NET 5 that can be used in mobile application development
  • Explore Xamarin.Forms Shell for building cross-platform mobile UIs
  • Understand the technical design requirements of a consumer mobile app
  • Get to grips with advanced mobile development concepts such as app data management, push notifications, and graph APIs
  • Manage app data with Entity Framework Core
  • Use Microsoft's Project Rome for creating cross-device experiences with Xamarin
  • Become well-versed with implementing machine learning in your mobile apps

Who this book is for

This book is for ASP.NET Core developers who want to get started with mobile development using Xamarin and other Microsoft technologies. Working knowledge of C# programming is necessary to get started.

Table of contents

  1. Mobile Development with .NET
  2. Second Edition
  3. Contributors
  4. About the author
  5. About the reviewer
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Reviews
  7. Section 1: Understanding .NET
  8. Chapter 1: Getting Started with .NET 5.0
    1. Technical Requirements
    2. Exploring cross-platform development
      1. Developing fully native applications
      2. Hybrid applications
      3. Native cross-platform frameworks
    3. Understanding .NET Core
    4. Developing with .NET 5.0
      1. Creating a runtime-agnostic application
      2. Defining a runtime and self-contained deployment
      3. Defining a framework
    5. Summary
  9. Chapter 2: Defining Xamarin, Mono, and .NET Standard
    1. Understanding Xamarin
    2. Setting up Your Development Environment
    3. Creating your First Xamarin Application
      1. Xamarin on Android – Mono Droid
      2. Xamarin on iOS – Mono Touch
    4. Using .NET with Xamarin
    5. Xamarin.Forms
    6. Extending the reach
    7. Summary
  10. Chapter 3: Developing with Universal Windows Platform
    1. Introducing Universal Windows Platform
    2. Creating UWP applications
    3. Understanding XAML Differences
    4. Using .NET Standard and .NET Native with UWP
    5. Working with Platform extensions
    6. Summary
  11. Section 2: Xamarin and Xamarin.Forms
  12. Chapter 4: Developing Mobile Applications with Xamarin
    1. Technical Requirements
    2. Choosing between Xamarin and Xamarin.Forms
    3. Organizing Xamarin.Forms application projects
    4. Selecting the presentation architecture
      1. Model-View-Controller (MVC) implementation
      2. Model-View-ViewModel (MVVM) implementation
      3. Architectural Patterns for Unidirectional Data Flow
    5. Useful architectural patterns
      1. Inversion of Control
      2. Event aggregator
      3. Decorator
    6. Summary
  13. Chapter 5: UI Development with Xamarin
    1. Technical Requirements
    2. Application layout
      1. Consumer expectations
      2. Platform imperatives
      3. Development cost
    3. Implementing navigation structure
      1. Single-page view
      2. Simple navigation
      3. Multi-page views
      4. Master/detail view
    4. Implementing Shell Navigation
    5. Using Xamarin.Forms and native controls
      1. Layouts
      2. Xamarin.Forms view elements
      3. Native components
    6. Creating data-driven views
      1. Data binding essentials
      2. Value converters
      3. Triggers
      4. Visual states
    7. Collection Views
    8. Summary
  14. Chapter 6: Customizing Xamarin.Forms
    1. Technical Requirements
    2. Xamarin.Forms development domains
    3. Xamarin.Forms shared domains
      1. Using styles
      2. Creating behaviors
      3. Attached properties
      4. XAML markup extensions
    4. Customizing native domains
      1. Platform specifics
      2. Xamarin.Forms effects
      3. Composite customizations
    5. Creating Custom Controls
      1. Creating a Xamarin.Forms control
      2. Creating a custom renderer
      3. Creating a custom Xamarin.Forms control
    6. Summary
  15. Section 3: Azure Cloud Services
  16. Chapter 7: Azure Services for Mobile Applications
    1. An overview of Azure services
      1. An introduction to distributed systems
      2. Cloud architecture
      3. Azure service providers and resource types
    2. Data stores
      1. Relational database resources
      2. Azure storage
      3. Cosmos DB
      4. Azure Cache for Redis
    3. Azure Serverless
      1. Azure functions
      2. Azure Logic apps
      3. Azure Event Grid
    4. Development services
      1. Azure DevOps
      2. Visual Studio App Center
    5. Summary
  17. Chapter 8: Creating a Datastore with Cosmos DB
    1. Technical Requirements
    2. The basics of Cosmos DB
      1. Global distribution
      2. Consistency spectrum
      3. Pricing
    3. Data access models
      1. The SQL API
      2. The MongoDB API
      3. Others
    4. Modeling data
      1. Creating and accessing documents
      2. Denormalized data
      3. Referenced data
    5. Cosmos DB in depth
      1. Partitioning
      2. Indexing
      3. Programmability
      4. The change feed
    6. Summary
  18. Chapter 9: Creating Microservices Azure App Services
    1. Technical requirements
    2. Choosing the right app model
      1. Azure virtual machines
      2. Containers in Azure
      3. Microservices with Azure Service Fabric
      4. Azure App Service
    3. Creating our first microservice
      1. Initial setup
      2. Implementing retrieval actions
      3. Implementing update methods
      4. Implementing a soft delete
    4. Integrating with Redis cache
    5. Hosting the services
      1. Azure Web App for App Service
      2. Containerizing services
    6. Securing the application
      1. ASP.NET Core Identity
      2. Azure AD
      3. Azure AD B2C
    7. Summary
  19. Chapter 10: Using .NET Core for Azure Serverless
    1. Understanding Azure Serverless
    2. Developing Azure Functions
      1. Using Azure Function Runtimes
      2. Function triggers and bindings
      3. Configuring functions
      4. Hosting functions
      5. Creating our first Azure function
    3. Developing a Logic App
      1. Implementing Logic Apps
      2. Using connectors
      3. Creating our first Logic App
      4. Workflow execution control
    4. Integration with Azure services
      1. Repository
      2. Queue-based processing
      3. Event aggregation
    5. Summary
  20. Section 4: Advanced Mobile Development
  21. Chapter 11: Fluid Applications with Asynchronous Patterns
    1. Utilizing tasks and awaitables
      1. Task-based execution
      2. Synchronization context
      3. Single execution guarantee
      4. Logical tasks
      5. The command pattern
      6. Creating producers/consumers
      7. Using observables and data streams
    2. Asynchronous execution patterns
      1. Service initialization pattern
      2. Asynchronous event handling
      3. The asynchronous command
    3. Native asynchronous execution
      1. Android services
      2. iOS backgrounding
    4. Summary
  22. Chapter 12: Managing Application Data
    1. Improving HTTP performance with transient caching
      1. Client cache aside
      2. Entity tag (ETag) validation
      3. Key/value store
    2. Persistent relational data cache
      1. SQLite.NET
      2. Entity Framework Core
    3. Data access patterns
      1. Implementing the repository pattern
      2. Observable repository
    4. Summary
  23. Chapter 13: Engaging Users with Notifications and the Graph API
    1. Understanding Native Notification Services
      1. Notification providers
      2. Sending notifications with PNS
      3. General constraints
    2. Azure Notification Hubs
      1. Notification Hubs infrastructure
      2. Notifications using Azure Notification Hubs
    3. Creating a notification service
      1. Defining the requirements
      2. Device registration
      3. Transmitting notifications
      4. Broadcasting to multiple devices
      5. Advanced scenarios
    4. The Graph API and Project Rome
      1. The Graph API
      2. Project Rome
    5. Summary
  24. Section 5: Application Life Cycle Management
  25. Chapter 14: Azure DevOps and Visual Studio App Center
    1. Using Azure DevOps and Git
      1. Creating a Git repository with Azure DevOps
      2. Branching strategy
      3. Managing development branches
    2. Creating Xamarin application packages
      1. Using Xamarin build templates
      2. Environment-specific configurations
      3. Creating and utilizing artifacts
    3. App Center for Xamarin
      1. Integrating with the source repository and builds
      2. Setting up distribution rings
    4. Distributing with App Center
      1. App Center releases
      2. AppCenter distribution groups
      3. App Center distribution to production
    5. App Center telemetry and diagnostics
    6. Summary
  26. Chapter 15: Application Telemetry with Application Insights
    1. Collecting insights for Xamarin applications
      1. The telemetry data model
      2. Advanced application telemetry
      3. Exporting App Center telemetry data to Azure
    2. Collecting telemetry data for Azure Service
      1. Application Insights data model
      2. Collecting telemetry data with ASP.NET Core
      3. Collecting telemetry with Azure Functions
    3. Analyzing data
    4. Summary
  27. Chapter 16: Automated Testing
    1. Maintaining application integrity with tests
      1. Arrange, Act, and Assert
      2. Creating unit tests with mocks
      3. Fixtures and data-driven tests
    2. Maintaining cross-module integrity with integration tests
      1. Testing client-server communication
      2. Implementing platform tests
    3. Automated UI tests
      1. Xamarin.UITests
      2. Page Object Pattern
    4. Summary
  28. Chapter 17: Deploying Azure Modules
    1. Creating an ARM template
    2. ARM template concepts
    3. Using Azure DevOps for ARM templates
    4. Deploying .NET Core applications
    5. Summary
  29. Chapter 18: CI/CD with Azure DevOps
    1. Introducing CI/CD
    2. CI/CD with GitFlow
      1. Development
      2. Pull request/merge
      3. The CI phase
      4. Release branch
      5. Hotfix branches
      6. Production
    3. The QA process
      1. Code review
      2. Testing
      3. Static code analysis with SonarQube
    4. Creating and using release templates
      1. Azure DevOps releases
      2. Xamarin release template
      3. Azure web application release
    5. Summary
    6. Why subscribe?
  30. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Leave a review - let other readers know what you think

Product information

  • Title: Mobile Development with .NET- Second Edition
  • Author(s): Can Bilgin
  • Release date: April 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781800204690