Using .NET MAUI to Build a Mobile App
Published Nov 22 2022 02:46 AM 1,765 Views
Microsoft

A picture showing .NETA picture showing .NET

What is .NET MAUI?

.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. Using .NET MAUI, you can develop apps that can run on Android, iOS, macOS, and Windows from a single shared code-base.

Using .NET MAUI, you can create multi-platform apps using a single project, but you can add platform-specific source code and resources if necessary. One of the key aims of .NET MAUI is to enable you to implement as much of your app logic and UI layout as possible in a single code-base.

 

In this blog, we will cover how to Build a Water Consumption Mobile App using .NET MAUI that consumes historical data from a Web API. This solution is part of a project build for .NET Conf Student Zone 2022

 

What will we be doing?

Before you can get started, we need a few things set up first:

  1. Build a Mininal API from scratch to consume in your app
  2. Build your first .NET MAUI App
  3. Add a Consumption.cs class with the following properties
    A picture showing the Consumption.cs classA picture showing the Consumption.cs class
  4. Add a APIManager.cs class to house the HTTP methods for your API
    A picture showing the APIManager.cs classA picture showing the APIManager.cs class

After the above are added, you can start to:

  • Consume A Web API – this will show how you to consume the historical data stored in the Web API and display on your mobile app.
  • Send data to your Web API using the HTTP Post Method (shown in the link above too).

 

We have a dedicated Microsoft learn module that will show you how to Consume and Send Data to your Web API. All of the code for this part of the project and other parts are available on the .NET Student Zone Githup Repositry

 

To see and understand the how to implement this in Visual Studio you can watch my session below.

Finally, if you are curious about where the API data comes from, you can explore the other sessions of the .Net Student Conf and understand how all the different pieces and different technologies of .NET ecosystem are combined together into a single e-2-e project.

Co-Authors
Version history
Last update:
‎Nov 22 2022 02:51 AM
Updated by: