That's right, everyone today.
We're checking out Donna Maui preview one.
So let's get into it.
Hey everyone.
I'm James bonds, a Magnum.
And today we are checking out the latest bits of dotnet six preview two, and
the very first preview of.net Maui, the multi-platform app UI toolkit.
Now I'm super excited about this because, and Maui, we just did a video on it and
I said, should you learn Xamarin now?
Should you wait for Don Moe?
And the answer is.
You should definitely learn Xamarin right now today because all of
your knowledge and your skills and your C sharp and you're done, and
knowledge is going to apply to Don and Maui later on when it releases
with Donna six in November of 2021.
Now this is really cool though, because that means that we can just
start playing with stuff, right.
We can check out new awesome, cool dev tools and platforms
I'm with Donna and Maui.
So let's just.
Do it, to be honest with you.
And that's what I want to do today.
I was streaming over on Twitch TV slash jeans, Monta Magno, and I did a whole sort
of dry run, checking it out from scratch.
So today we're going to condense that down and I'm going to show you what
you need to get started with Donna Maui, visual studio, and dotnet six.
So let's get into it.
All right, everyone.
So here's this awesome blog post from my good friend, rich Lander telling
you everything about dotnet six.
Preview.
To now what you'll note here is that it includes early builds of Donna and
Maui early builds on some, we're going to say, this is the very, very first
release of Donald Maui and there's tons of stuff inside of this thing.
Tons of stuff.
Inside of Don Essex preview, too, you can learn about ASPI core updates, EFI
updates, but here are the big things.
Android iOS Mac, Mac catalyst support coming into darkness,
six, bringing everything together.
So you can read through this amazing, amazing blog post about
performance, all this stuff.
Great update here about Xamarin development, how it's
being rolled into Dennis six.
And then here is the net multi-platform app UI, Don and Maui.
Now I mentioned earlier that this is the.
Evolution of Xamarin forms.
That is the next version, the next iteration, the next restructuring.
And I talked about in my previous video that I put up over there about how have
you start with Xamarin forms today, you can easily upgrade and migrate
to Donna and Maui and all the XAML.
All of your shared code.
All of your libraries will continue to work.
There'll be some cool upgrades because it is switching over to the SDK style
projects, multi targeting with a single project and adding a bunch of cool stuff
like shared fonts and images and things like that, which is really, really cool.
Now my favorite part though, of Don and Maui is that it's going to switch to the
host builder, similar to blazer asp.net for all of your dependency, injection,
and set up of icons and fonts and all this cool stuff is a really, really cool stuff.
Now I'm not going to get too much into Don and Mallory, because
again, this is preview one.
So things are going to change, but I want to get you set up so you can
actually build a Macko S app, an iOS app.
And an Android application and of course, windows is coming with when you, I three
and that's not quite in this preview yet.
Now inside of here, inside of this blog post, you're going to find this repo,
this hello, Maui sample application.
And I'll put this in the show notes, of course, below.
Now this is an awesome, a repo that has.
All sorts of projects, Android iOS, Mac catalyst, and Dyna Maui.
So down in Maui built on top of iOS and Android and Mac for.net.
So built into Donna six.
So what do we need to do to get started?
Well, the very first thing is that you need visual studio 2019.
So if you have visual studio, you'll see the installer here.
And what we want is the latest version, 16 dot nine.
Or if you're on Mac eight dot nine.
Okay.
Over there.
That's the latest version of visual studio, 2019.
Any addition I have community edition here.
You don't even need preview.
You can use it if you want to.
Now with this preview of Don and Maui, there's different forms of support
for visual studio, visual studio for Mac command line and vs code.
And we'll talk about that here.
As things go now.
You will need to install Don at six.
So if you're on Mac or PC it's here, this is the same exact version
that is on the dinette website.
So the same thing that's in the blog post, it's the same version and you can download
it from here or there it's the same link.
So you install that and it takes about 30 seconds to download about
170 megs and boom, you are good to go.
Next up you'll need to install the iOS and Android workloads.
Okay.
Now, um, this is important because Don at six, you know,
ships the components separately, basically from my understanding.
So this is a workload for Android and iOS that you'll install on top of Donna six.
I downloaded these MSI files for windows.
They take like 30 seconds to insult so crazy fast and you're good to go.
Now, if you are on a Mac and you want to try Mac catalyst, you will need
to install the Mac version over here.
Um, which is really cool.
The final bit that I'll talk about though, is that if you're on windows
and you want to actually run.
An iOS app, you will need a host, a connected host, um, from visual
studio and you will need to install all the same things on a Mac.
Now, I only tested Android up to this point and it kind of made sense
cause I'm just everything local here, but you could totally do that.
All right, check this out.
So over here, we have some information about Android, the SDKs that
you'll need iOS, the versions of X code you need and Don and Maui.
And it does give us information about visual studio and visual studio for Mac.
So right now, today of this recording of preview one visual studio, 16,
nine, it only supports visual studio on windows for Android and iOS.
Danette six projects and not.net Maui.
Yet from it.
Okay.
And we'll talk about the animal we'll build and we'll do some stuff on here
for visual studio for Mac, nothing yet.
So it's just command line.
However, over here, visual studio code does have debugging support.
For Android, which is super cool.
We'll talk about that here in a bit.
Okay.
So again, very, very early bits.
Get that in your mind, right?
This is super crazy early.
Um, so if you want to set this up, you want this working in visual studio,
just to check out Android, to give it, uh, give some feedback to the team.
You will have to create this file via command line.
It's called enable workload resolver dot Sentinel.
I have no idea what that means, but it's kind of cool.
Kind of feels futuristic.
And that's how you do it.
So here's what we're going to do.
I'm going to copy and we're going to clone this.
So I'm going to go into visual studio.
Let's pop that up.
There we go.
And I'm going to say clone a repository and paste that in done.
All right.
So what's nice about this, that there's a bunch of different projects
and solutions for you to check out.
So we're going to note over here and the solution explorers.
We have samples, which has all three solutions, Android, iOS,
and Donna Maui right here.
Now.
Right from visual studio, we can open the Android solution,
which is just an Android project.
So this is dot, not dot Xamarin forms, not Donna Maui.
This is just an Android project, nothing else, just a few
material design components.
And if I right click and I hit edit project, or we're going to note is
that this is the entire project.
Okay.
Has everything here?
Which is kind of crazy.
It loads up the Android emulators and I can hit build and I can start running.
Okay.
This is going to build this application all this off now to get this working.
Remember that I came over here and I had to enable visual studio support.
Okay.
By running this command and I'm using community edition.
Yeah.
So I did swap out enterprise for community and that's how I got that working.
Now, um, when you go ahead and debug, this is going to build obviously, and it's
going to take a little bit of time, but it will also launch your Android emulator.
So visual studio on windows w automatically, or Mac automatically
bring this up, but you can always come into tools, Android,
Android, device manager, and.
You can go ahead and bring up the Android device manager and run this manually.
Okay.
And you'll have to do this if you're running it via command line or from
vs code today, but there we go.
Literally, an Android application running on Donna six.
Boom.
Done.
All right, so let's do Donna Maui.
Okay.
So let's do this.
Let's go ahead.
Close visual studio, but boop, leave our emulator up.
Okay.
We're going to do that though.
And what we're going to do now.
Is we're going to go ahead and we are going to look to see
how do we build this thing?
Okay.
Here we can do Donnette build, which is really nice since it's part of Don
at six, we can just do done at bill.
Hello, iOS.
Hello, Android.
And we can do S dash T run, which would run it on an emulator.
Same thing here.
Now, again, your emulator needs to be running or attached.
If you have your Android device attached, it needs to be attached to there.
So let's go ahead and bring up a command prompt.
Here we go.
And I'm going to do a CD here and we're going to do.net build
and I'll say, hello, Maui.
And you have the option.
If I just do Don at build Maui, it's going to build my iOS, Android and
my Android application over here.
Um, because if we look inside of here and we look at our project in
vs code per se, we're going to note.
That it says net six, Android net six iOS.
It has single projects that to true application ID Maui is the title
version codes are inside of here.
It has the downtime, Maui new get package.
And finally it has all of our app icons images and fonts
built right in here, which is.
Crazy.
Awesome.
Okay.
So just to save time, I'm just going to do dash AF, which is going to
tell it what target framework to run.
This is kind of new here.
So I'm going to say net 6.0 dash Android.
Okay.
So this should determine projects, restore my new, get packages, and then
actually go ahead and like build it.
And then I'm ready to go.
So let's see how long this takes.
So this may take a little bit of time.
Obviously it's spinning up Don at six here doing some things on my machine.
Um, but at this point it is building my Android application with, at
six, with Don Maui, all 100%.
So let's give it a few seconds to do its thing.
All right.
There we go.
So the first bill took just about a minute or so, so let's
go ahead and now deploy it.
So I'm going to say build hello, Maui.
But now I'm going to do dash T run.
Okay.
Now, It may give you this error that the run doesn't exist.
And we can actually note that there's an issue right now, or we're going to
need to do dash dash no dash restore.
Okay.
And when we do that, it will then work.
Okay.
So that's going to take that, build that thing that I have.
And it's going to go ahead and now boot it up.
And it's going to attempt to connect over here and say they already built once
that only like nine seconds this time.
And now I have a.net Maui application right here.
I can click, I can see it increasing.
I can use my sliders over here.
I have entries coming up over here, which is super awesome.
And to have it all right here.
Now, if I wanted to, of course I could come in and I could
open one of these files.
So let's move this over here and let's go ahead and just open up the XAML file.
Okay.
And I could change this, um, text color to let's say orange, for example, hit, save.
Let's go back over here, run again, build it up, do some diffing going on
and this should boot up our emulator.
One more time.
There we go.
And then what it'll do is take my changes that I just had over here in this file
and then deploy it yet again to, um, here.
And again, it was pretty quick because it already built it once I
needed a diff and now it's orange.
Boom.
Good to go.
Now it is like I said, an early bit, so we don't see a hot reload.
We don't see, you know, um, debugging from visual studio, things like that yet.
But now that we have it running from the command line, we can.
Actually open up this project in vs code.
Okay.
So I've been opening just files, but let's go ahead and close these.
And what I'm going to do is I'm going to go ahead and
open up the hello Maui folder.
Okay.
Inside of here.
And I'm sorry, not the hello Maui folder.
That's important.
Well, we actually want to open is the entire entire sample repo.
So what they did is they actually have a workspace.
Set up.
Let me go ahead and zoom in over as you can see it, they have a workspace set
up and you can hit open a workspace.
Of course my face is in the way.
So we'll just say an open workspace.
Okay.
And so they've set this up for us automatically.
And this shows us all of the code that's inside of here.
So we have actually, hello, Maui had these files open earlier.
Here's our orange that's here.
We have our main page code behind, under here, and here's our view.
That's being created our button click event.
That's happening here.
All good to go.
Now, this being said.
I want to make sure that you kind of are aware that while this is early, it kind
of shows off some of the really cool stuff, things that you can do, um, with
Don and Maui and how this is changing.
So we have this view property, which is starting of an MDU pattern here.
Of course we have normal button clicks.
This could be, MVVM a fight.
If we wanted to, we have a font family here that has, um, is being registered.
Inside of our application class.
So we can see configure fonts and you can see it has I window, which
will be a windows management system.
Um, so if you're doing desktop applications or things like that, that'll
be built right in and it's a Maui app.
It's pretty cool.
So let's check this out.
What I'm going to do is I'm going to open up this page.
I have a break point here.
Let's go ahead and hit debug.
In the window.
It says debug node, uh, sorry.
Debug net six mobile samples.
So I'm going to debug, it's going to ask me, what do I want to debug?
Well, hello, Maui, Android.
Debug attached to bugger.
True.
So it's kind of built into vs.
Code.
This initial support here.
The only extension I needed to install was the mano debugger, which actually popped
up and told me to actually install that.
So let's go ahead and see if this is going to run over here.
There we go.
So it stopped and it's building any changes over here that it may need.
And then it's going to go ahead and boot it up and you can see it's building out
here and it's deployed and there we go.
All right.
So there we go.
If I hit click me, I see the count.
I go ahead and go over.
We see the count is one over here and our window we can continue on now.
Of course I've collected yet again.
So I click a one more time.
We have two, we have three.
There we go.
All right.
I can remove that break point and we're good to go again.
I can click, click, click, click, and we're done.
Now the same thing over here, though, is if I wanted to
change this and say to read.
Again, there's no hot reload as of preview one right now, because
it's really, really early bits.
But of course I can go ahead and redo this redeploy yet again and simply
get my debug session up and running.
And now I'm actually debugging making changes to my Donnette Maui application.
To my Android emulator or device from vs code.
And again, this only takes a few seconds to compile and get going
and booting it up over here.
There we go.
I mean, that's it.
That's all you gotta do.
And that is how you get started with dada Maui, building iOS and Android
Mac applications in preview one.
These are super early bits, but I wanted to walk you through sort of the setup,
what is required, how do you get going?
And of course you can have feedback by submitting that into the dine-in
Maui, repo as things progress.
I guess that in my last video, you know, this is fun to play around with.
And I was really excited to get it working, especially in preview one,
but it's an early preview, right?
It's a very first preview and it's going to be really fun to
see it advance and go forward.
So as we're continuing to build up our Xamarin applications,
we do our one oh one, right.
All of that knowledge is going to come over to Donna and Maui.
And then we'll add in some new flavors, some really cool things
like those, um, app icons, those resources, those fonts, the single
project, um, all sorts of good stuff.
And of course, Mac catalyst support.
Anyways, I really hope that you found this interesting hope you give it a try.
Whether you're on Mac or over on windows.
Definitely.
Let me know how your experience went.
I'm sure the dev team would absolutely love to know.
Um, but I had fun doing this.
I hope that you enjoyed it and hope that you give this channel a subscribe
and a thumbs up and a ding of that notification, bell, all those things.
So you get notified that thumbs up, though.
It does go into the Google algorithm of goodness and helps
recommend this video to others.
Of course, you can follow me on Twitter or.
And Twitch at Twitch ITV slash James amounts of Magna, where I
live stream every Friday, man.
I hope that you really, really enjoy these videos and give Don and Maui a try.
Um, but I hope that you continue to follow along on my Xamarin one-on-one tutorial
series right here on my channel, but thanks everyone for watching and please
leave comments below and I'll try and get to all of them that I possibly can.