Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
.NET MAUI Cross-Platform Application Development

You're reading from   .NET MAUI Cross-Platform Application Development Leverage a first-class cross-platform UI framework to build native apps on multiple platforms

Arrow left icon
Product type Paperback
Published in Jan 2023
Publisher Packt
ISBN-13 9781800569225
Length 400 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roger Ye Roger Ye
Author Profile Icon Roger Ye
Roger Ye
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: Exploring .NET MAUI
2. Chapter 1: Getting Started with .NET MAUI FREE CHAPTER 3. Chapter 2: Building Our First .NET MAUI App 4. Chapter 3: User Interface Design with XAML 5. Chapter 4: Exploring MVVM and Data Binding 6. Chapter 5: Navigation using .NET MAUI Shell and NavigationPage 7. Chapter 6: Introducing Dependency Injection and Platform-Specific Services 8. Part 2: Implementing .NET MAUI Blazor
9. Chapter 7: Introducing Blazor Hybrid App Development 10. Chapter 8: Understanding the Blazor Layout and Routing 11. Chapter 9: Implementing Blazor Components 12. Chapter 10: Advanced Topics in Creating Razor Components 13. Part 3: Testing and Deployment
14. Chapter 11: Developing Unit Tests 15. Chapter 12: Deploying and Publishing in App Stores 16. Index 17. Other Books You May Enjoy

An overview of cross-platform technologies

Before discussing cross-platform technologies, let’s review the application development landscape first to understand the different cross-platform technologies better.

.NET MAUI is a cross-platform development framework from Microsoft for building apps, targeting both mobile and desktop form factors on Android, iOS, macOS, Windows, and Tizen.

Generally, software development can be divided into two categories – systems programming and application programming. Application programming aims to produce software that provides services to the user directly, whereas system programming aims to produce software and software platforms that provide services to other software. In the .NET domain, the development of the .NET platform itself belongs to systems programming, whereas the application development on top of the .NET platform belongs to application programming.

The design or architecture in a modern system includes the client and server side of software, which we can refer to as the frontend and backend.

For the software on the client side, we can further divide it into two categories – native applications and web applications.

Native applications

In native application development, we usually refer to application development for a particular operating system. With desktop applications, this could be Windows applications, macOS applications, or Linux applications. With mobile applications, this could be Android or iOS.

When we develop a native application, we have to develop it for each platform (Windows, Linux, Android, or macOS/iOS). We need to use different programming languages, tools, and libraries to develop each of them individually.

Web applications

Web application development has gone through several generations of evolution over the past few decades, from a Netscape browser with static web pages to a modern single-page application (SPA) using JavaScript frameworks (such as React or Angular). In web application development, JavaScript and various JavaScript-based frameworks dominate the market. In the .NET ecosystem, Blazor is trying to catch up in this area.

Backend services

Both native applications and web applications usually need some backend services to access business logic or a database. For backend development, many languages and frameworks can be used, such as Java/Spring, .NET, Node.js, Ruby on Rails, or Python/Django. Usually, native applications and web applications can share the same backend service. Java and .NET are the most popular choices for backend service developments.

Cross-platform technologies

Technologies used in web application development and backend services development are not platform-specific and can be used on different platforms as they are. When we talk about cross-platform development, we usually refer to native application development. In native application development, cross-platform development technologies can help to reduce costs and improve efficiency. The most popular cross-platform development technologies in this category include Flutter, .NET MAUI/Xamarin, and React Native. Table 1.1 provides an overview of available cross-platform technologies and alternative solutions from Microsoft. The technologies listed here are not exhaustive. I just want to give you a feeling of what kind of technologies exist in each category and what Microsoft solution can be used as an alternative.

Category

Cross-platform technologies

Microsoft solution

Language

Framework

Web application

JavaScript

React, Angular, or Vue

Blazor/Razor Pages

Native application

JavaScript

React Native, Cordova, Ionic, Electron, or NW.js

.NET MAUI/Blazor/Xamarin

Dart

Flutter

Java/Kotlin

Swing/Codename One

Backend services

Java

Spring

ASP.NET Core

JavaScript

Node.js

Python

Diango/Flask/Tornado

Table 1.1: A comparison of languages and frameworks with Microsoft solutions

There is no best choice of cross-platform tool or framework. The final choice is usually decided according to business requirements. However, from the preceding table, we can see that the .NET ecosystem provides a full spectrum of tools for your requirements. The development team for a large system usually requires people with experience in different programming languages and frameworks. With .NET, the complexity of programming languages and frameworks can be dramatically simplified.

A comparison of .NET, Java, and JavaScript

We had an overview of the tools and frameworks used in web apps, native apps, and backend services development. If we look at a higher level, that is, at the .NET ecosystem level, the ecosystem of Java or JavaScript can match almost what we have in a .NET solution. Java, JavaScript, or .NET solutions can provide tools or frameworks at nearly all layers. It would be interesting to compare Java, JavaScript, and .NET at a higher level.

Java is developed as a language with the goal to write once and run anywhere. It is built around the Java programming language and the Java Virtual Machine (JVM). The JVM is a mechanism to run on supported platforms that helps to remove platform dependency for developers. With this cross-platform capability, Java becomes a common choice for cross-platform applications and services development.

JavaScript is a language created for web browsers, and its capability is extensive due to the demands of web development. The limitation of JavaScript is that it is a scripting language, so it lacks the language features that can be found in Java or C#. However, this limitation doesn’t limit its usage and popularity. Table 1.2 offers a comparison of three technologies:

Area of comparison

.NET

Java

JavaScript

Programming languages

C#, F#, VB, C++, PHP, Ruby, Python, and more

Java, Kotlin, Clojure, Groovy, Scala, and more

JavaScript, TypeScript, CoffeeScript, and more

Runtime

CLR

JVM

V8/SpiderMonkey/JavaScriptCore

Supported IDE

Microsoft Visual Studio, Rider, MonoDevelop, and Visual Studio Code

Eclipse, IntelliJ Idea, Oracle NetBeans, and Oracle JDeveloper

Visual Studio Code, Webstorm, and Atom

Frontend framework

ASP.NET Core Razor/Blazor

Only supports server-side rendering such as JSP or Thymeleaf

React, Angular, or Vue

Desktop apps

WinForms, Win UI, WPF, UWP, and more

Swing, JavaFX, and more

Electron, NW.js, and more

Mobile apps

.NET MAUI/Xamarin

Codename One

React Native, Cordova, Iconic, and more

Backend framework

ASP.NET Core

The Spring Framework

Node.js

Table 1.2: A comparison of Java, JavaScript, and .NET

From Table 1.2, we can see that both .NET and Java have a good infrastructure to support multiple languages. JavaScript has its limitation as a scripting language, so TypeScript and CoffeeScript were invented to enhance it. TypeScript was developed by Microsoft to bring modern object-oriented language features to JavaScript. TypeScript is compiled into JavaScript for execution, so it can work well with existing JavaScript libraries.

Java is built around the JVM while .NET is built around the Common Language Runtime (CLR) and the Common Type System (CTS). With the CTS and CLR as the core of a .NET implementation, it supports multiple languages naturally with the capability to share a Base Class Library (BCL) in all supported languages.

While there are multiple languages that use the JVM as the abstraction layer for cross-platform capability, the interoperation between Java-derived languages is not at the same level as .NET languages. All .NET languages are built on one architecture and share the same BCL, while Java languages, such as Java, Kotlin, or Scala, are developed separately for very different purposes.

This comparison helps us to choose or evaluate a tech stack for cross-platform development. As a .NET MAUI developer, this analysis can help you understand your choice better. To understand where .NET MAUI is located in the .NET ecosystem, let’s have a quick overview of the history of the .NET landscape in the next section.

You have been reading a chapter from
.NET MAUI Cross-Platform Application Development
Published in: Jan 2023
Publisher: Packt
ISBN-13: 9781800569225
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image