 I'm pretty excited because we have my good friend here. Coming up next, cross-platform mobile apps made easy using Xamarin with the fabulous and amazing James Montemagno. I try to hang out with him a lot, but he won't let me in his house. I was only there at three last night. I mean, you didn't let me in. What the heck? Sorry. I mean, I was asleep. I was prepping. Oh, that's right, that's right. I was getting ready for this. All right, James. Take it away, buddy. Awesome. Well, thanks, Seth. The problem is what came at two. Boom, you can, I'll buzz you in. Three, that's too late for me. So, well, thanks everyone. I'm really excited to actually talk about today all the really exciting enhancements that we have for .NET development, for mobile applications with Xamarin and Visual Studio 2019. You may have seen me a few times before on Channel 9 and on YouTube doing the Xamarin show, which we record every single week and put out for all of the things that you're going to do. So, I want to kind of walk through a few things today, show off some apps what we're building in VS 2019, both on Windows and on the Mac, and show you some of the new features, but also for anyone brand new to mobile development with .NET and Xamarin. I'm going to walk you through the basics. I don't want to do too many slides. I want to get into demos. So, let's get started. Now, what I think about mobile development or just development in general here at Microsoft, we want you to be able to build for any platform humanly possible and that's where .NET comes in. Whether you want to build a desktop app with WPF or UWP or WinForms, a mobile app with Xamarin for iOS or Android, an IoT device, a web application, .NET is for you. And Xamarin fits right inside of here. So, building iOS, Android apps, Mac applications, TVOS, watch applications. So, Xamarin is part of .NET and it's all inside of Visual Studio for you. So, I like to define really quick of like, what is Xamarin? You know, people are thinking, what is Xamarin? And you're saying it's part of .NET. Well, I like to define Xamarin as an open source app platform from Microsoft for building modern and performant iOS, Android, Mac OS, watch OS and TVOS applications all with C-Sharp and .NET. That means that you can reuse your existing C-Sharp and .NET skills to, you know, write apps for all of these different platforms humanly possible. And I'll walk through what that means from like shared logic and user interface and how these applications are native. So, let's talk about that app development. You know, with Xamarin, we want to give you productive environment, reuse all of the things that you love in Visual Studio and Visual Studio from Macs, reuse all of your code across different platforms. We want these applications have great integrations and native performance and of course integrate into that expansive ecosystem of .NET. So, when I think of the app architecture really quick, I think of it like this, is we have these head projects, iOS projects, Android projects and now with Xamarin and then any other .NET application. Could be a UWP app, a WPF application, your web applications and then what we're gonna do is share a bulk of our C-Sharp business logic, platform APIs and user interface, depending on how much or how little you want to share between all of them. But the unique part is that Xamarin delivers the ability to build out native apps for each and then share a bulk of your code while being native. So, those native APRs are kind of what you would kind of expect when you use your phone. So, things like fingerprint permissions, augmented reality, machine learning, music APIs, Google Play services, camera, all those great native APIs. And for Xamarin, we give you all of those APIs for iOS, Android and all the other platforms all in C-Sharp, all inside of Visual Studio. Now, each platform's pretty unique and have different APIs, but there are some similarities between all of them. So, we try to simplify that aspect of the development with Xamarin and .NET. And that's why we created Xamarin Essentials, which is a single library that enables developers to access native APIs from a shared single cross-platform library. So, things like secure settings and preferences and geolocation connectivity, all from a single API. So, now we can kind of see, well, we have business logic, that's those .NET logic, right? Models, view models, restful service calls, Xamarin Essentials kind of lifts it up here. So, what we can do is take that model of the architecture and kind of expand it. It's still a blue box because it's still shared across the different platforms. But what about the user interface bits and pieces of it? You can build out native UIs on each platform, but we also thought about, well, developers wanting to share even more code. And that's where Xamarin Forms comes in, which is a library that enables you to share cross-platform user interface on different platforms like iOS, Android and UWP. So, I'd like to define it as an open source mobile UI framework from Microsoft for building iOS, Android and Windows apps with .NET from a single shared C-Sharp code base. Now, what's great about this is that you take that exact same model, right? Where we had C-Sharp business logic, models, view models, restful service calls, Xamarin Essentials, and now Xamarin Forms for your user interface. And you can mix and match as much or as little of this as you want. So, it could be all of your apps, some of your app or none of your app because you can still build out native Android user interfaces and iOS user interfaces as well. But most of our developers on average share over 80% of code across all these different platforms. So, let's just get into it. Let's build an app. So, I'm gonna go ahead and just pull up Visual Studio 2019 or get to code experience. And when you say create a new project, what you're gonna find in here is all the project templates that you would expect. And over here, we can go ahead and drop down and tap on mobile. And when you say project type mobile, you're gonna see all of the different Xamarin projects and .NET projects in here. You can also come in and say, I want Android or iOS or TVOS or Windows platforms specifically. And what you know is that we have Android projects, iOS projects, Android Wear, WatchOS. Down here, we have these binding libraries which enable you to bring over native libraries from iOS and Android into your Xamarin apps and even TVOS applications right here from this toolbox. If you select mobile app, that's gonna give you the cross-platform user interface with Xamarin Forms, it even says Xamarin Forms right there. And when you select next, you can create your project and you get a few more options here. So we've redone some of these and here we can go ahead and tap on Master Detail for like a flyout navigation, tabbed, a blank application, and we have a new preview of Shell which handles all of your app navigation. Now on any of these, you can select your platforms, add additional platforms like UWP or other ones in there and you can even add a ASP.NET Core Web API backend. So I've already done that and configured it just like this and what I'm gonna do is open that project and walk through it. So here I am inside of it. So let's zoom in a little bit because I love to zoom. And what we'll notice here is that I have an Android project, an iOS project, and a ASP.NET Core Web API backend. So this backend here is just a standard API controller. I actually have it running here inside of Castro which is our cross-platform web server backend that will enable me to debug locally on my Android device. And these head projects are just kind of what I described there. And I also have a.NET standard library which is just my first mobile app. And under SDK, it's a.NET standard library. It has my models. I have services in here, view models and I have shared XAML user interface across all these platforms for iOS and Android here. Now I also have some NuGet packages. So I have like JSON.NET. You can pull down basically anything from NuGet. Then I have Xamarin Essentials and Xamarin Forms. I'm also bringing in a new library that we just released called Xamarin Forms Visual Material that will enable me to do material design across each of the platforms that we support which is really nice for iOS and Android. So this is just like a.NET standard library. Here's everything that we see. And what I wanna show you is what sort of the user interface looks like at a high level. So we have that item controller and we need to query it. So in my code behind, I have a items view model. Here I'm just gonna use all C-sharp.NET that'll be shared across. I have an observable collection of items. When I want to load them, I will simply call execute load items. It's gonna go off to my data store which I'll show you in a few seconds here and then add those items to the list. Now in my user interface here for my items page, we have cross-platform XAML with Xamarin Forms. So inside of here it's an XML representation of my user interface. So over here I can pull out a toolbox, drag and drop controls right on the XAML. I can go ahead and tap on one of the controls. I get my property grid on the bottom right that you'd expect. And here I have a list view. So here I'm gonna go in, I can see my item source as items. I've pulled the refresh enabled. And then inside of this data cell I'm gonna give it a representation to display an icon and also a label here of the text and description. Now it's just C-sharp.NET logic, nothing crazy. So when I make that web backend call, it's gonna look a little bit like this. I have my Azure data store. It has an HTTP client that I've used for years. I have a URI that I specify with a backend. And over here I'm doing a few interesting things. Notice when I say get items async, it will go and get a string to call the API and use JSON.NET to deserialize it. It will also check for internet connectivity using Xamarin Essentials on iOS and Android. So a single API to check internet access there. Now the important part is that I've configured this app for a specific URL since I'm running it local. Here I've set my backend just to be local host, but notice that on Android, since it's gonna be an emulator, we're gonna just do the Android IP address for local host. And again, I'm gonna use Xamarin Essentials to say am I on Android use 10, 0, 2, 500, else use local host 5,000 for like iOS or UWP. So here I can pull up my Android emulator and we'll go ahead and bring up the web server in the backend. And I'm running my Android emulators here on top of Hyper-V. So we've extended Hyper-V to support the native Google Android emulators right out of the box. You can run Google Play services if you want on it, anything that you want. And here the application is loading. And here we have some tabs on the bottom and it's gonna go and make a web request and get some items. If I come in, add a new item and I say hello world. And we'll go ahead and drop that down and hit save up here. We'll notice that this is running in the backend. And in fact, I have Swagger running over here. And if I try out my web API, hit execute over here, we can see that this hello world right here is coming from my app, which is really cool. So as we start to think about how we're going to develop the user interface, we have a few tools in mind and not just only for editing the XAML. Perhaps you want to update this new item page. I don't really like that the cancel and saver here. So what I'm gonna do is come over to this new item page and we have our Xamarin.Forms previewer. So I can get a side by side of my XAML here. And what I'm gonna note here is that I don't really like this toolbar item. So we're gonna get rid of that. And what we can do down here is maybe add a button and notice that IntelliCode jumps in and gives me recommendations. I type B and B is in label and button and IntelliCode says button. It'll also recommend that I set text or the background color or the command here. So we'll go ahead and set the text of save. Let's do the clicked event to the save clicked event here. And let's just go ahead and set the background color over to let's say a static resource that I've defined called navigation primary. And then we can go ahead and close that out. There's my button it shows up. Now this little property that I just showed actually came from shared resources in all my apps. So that's where this navigation primary is coming from. So now that we have this here we can do a few things it shouldn't be right underneath it. Maybe I'll go ahead and modify let's say the vertical options and maybe do let's say end and expand. And it updates it over here for me inside my XAML so we can see it right here. One of my favorite things that we just added is design time data support. So here for instance I have some attributes to say D colon on anything. And what I can do in that is I could say D colon background color equals red for instance. And then in my design view I can see how much space it's actually filling up inside of it. Whereas as soon as I get rid of that it's gonna go back into my blue. So maybe here we wanna see text color equals let's say white here. So now we'll see it update to white. Now I really didn't like sort of that I had to have some labels to enter these items. I'd really love that material design look where the placeholder moves up and down. So what we can do here is enable a brand new feature of Xamarin Forms that we call visual. And we're gonna set this to material visual. And we're gonna see a few things change. Look at this inside of my preview. When I set default it changes to be a kind of a generic default button. If I change the material we now get updates inside of our user interface. So here what I can do on the label is actually just get rid of it. I can just say get out of here. And then over here maybe I'll set my placeholder equal to text which will move up once I enter it. The same thing here on the editor I'll say placeholder equals description. And we'll go ahead and set it here. Now what I do like is that with material buttons I can set like a corner radius on this button and start to make it look real good. Maybe I'll set it to 18. I can see it respond there which is nice. So let's go ahead with those changes see what this looks like as I rev this application. So I'm gonna now go in hit recompile redeploy. It's gonna recompile my Android application with the changes that I made and then deploy it to my Android emulator that's sitting over here. So let's give it a second to build up on my machine. Here we go. And see what it's gonna do here. I can go ahead and close this out. Here we go. And those design attributes that I showed work on any property. And I'll show you a little bit more what that looks like. So we've relaunched, we've worked a lot on optimizing the build times. You'll see a lot of improvements in Visual Studio 2019 for both iOS and Android. So here I have my application since I'm still running against that web server I get that hello world. Now I can hit add again. Now we're gonna get really nice material design here on both of these with literally zero work at all. And I'll say hello over here and I'll say from material design. There we go. And then on this button I get this really nice effect and I can save that back out and go ahead and it updates and I'm good to go. Now what I wanna show though is that inside this application I can also debug it right here on iOS with those same changes. I have it connected here to my Mac right here on the local guest network. And I can just see all of my iOS simulators right here or plug in a physical device to my Mac and have it debug over onto my iOS device or simulator. Now you may be saying, okay well there's a simulator now this is our remote at iOS simulator that we have when I hit debug. Where is that running? How can it talk to the web API backend? Well, the simulator is running on my Mac and we're sort of porting it over to the Windows machine. So I took the same project and ran the web server over on my Mac since this is literally running on local host on my Mac which is pretty nice. So now I'm in a full debug session from my Windows machine right here onto my iOS simulator. When I hit add I have the same exact material design that I would expect to have just like I had on my Android device. I can hit done here, then we can hit save. So boom, now we have the same exact application talking web API backend from my Windows machine. But I want to kind of take this a little bit further and tell you some of the other things that we're doing here especially with the design time data. So remember I had this big list of data here and I want to kind of rev on it a little bit. And if I pull out the previewer at this point we're going to see basically nothing inside of it. So it'll initialize up here and we'll see a big blank page. That's because there's a list of items and literally nothing in it. But I could take advantage of our good friend design time data. So here we have an item source and what I can do is kind of bring in a little templated code give it a design item source. So here I'll go ahead and copy in this item source and what I'm going to do is simply say empty strings at this point and I could say hello from visual studio. Now we see the frame because there's three items inside of here. And if I wanted to I could come down and simply say decolon text and I could set this equal to hello for instance which makes all of them hello or I could say binding dot which is really nice. I see hello from visual studio. Now let's take it to another level though because what I can do is not only just give it strings but give it full items inside of here. So let's go ahead and replace this item source of strings with the actual model. So what I've done here is I've added two items. One that says Scott Hanselman loves tacos and a picture of his face which is inside my iOS and Android project and the Visual Studio 2019 is an amazing IDE. So here we have an icon also a first name. So if I remove this icon we'll see it update with T there. If I come in and put the icon back which I even get IntelliSense for there to scott.png we'll go ahead and see Scott show up. Now this is nice because I've bound this icon and the text first and if I simply remove this design I'm gonna be using the real bindings but using design time data with a very, very little energy or effort at all. I can come in and just see Scott's beautiful face staring back at me over and over and over again which is exactly how I want to develop all of my applications which is why I developed a Scott Hanselman application that I've been building live and updating with all these new features. So I have Scott just looking at me right on my iOS and Android device 24 seven. It's pretty great. So those are some of the new features we have but I want to show you what this looks like when I take this exact same project and open it up in Visual Studio 2019 for Mac. So I'm going to swap over my HDMI right now over to my Mac. Here we go. And what we'll go ahead and see once it's on the screen is the same exact project. Over here I have my iOS, Android product project and ASP.NET Core backend. Now what I've done though is instead of hitting my backend of local host I've added in an Azure backend and published it. You can right click say publish, publish to Azure. This will query your subscriptions. You can send it right up to Azure. So now with the same exact project I can do things that I would expect. So here I can go into my about page over here. We're going to go ahead and see all the same XAML that's loading up. It should go ahead and load up my iOS previewer right here on my Mac. And in fact over on Visual Studio for Windows I could have seen that as well. I just need to click over to the iOS tab. So here I go. I see everything here and I can make changes and see it update. Now if I go ahead and debug this application what I'm going to show is that I'm running this over here inside of Azure right here. So if I go in and I say try it out and hit execute we're going to go ahead and see my items. One, two, three, four that are showing up. So now we're going to build our application. It's going to go into a full debug just like I did over on my Windows machine. There we go. And I'm going to be running this over on apparently my iPhone XS Max device which is actually kind of cool because it's going to have the notch inside of there. I'll show you one other thing about the items page, new item page on top of here which is that inside of the XAML we have special attributes for iOS and Android. So here we're going to use the safe area. And in fact on my main page I was specifying bottom tabs on Android some brand new properties there. So here's our application loading. Get it into debug mode. There we go. All of our project properties are there. I can go ahead and add a brand new one with all of our material design. Go ahead and hit save on there. And now we're hitting an Azure backend to save everything. So let me wrap up before we go into Q&A with some resources because you can grab all the source code from here and kind of summarize up here. So you've kind of seen end to end building an application, what you get out of the box but a lot more some of the brand new tools that we have built right into Visual Studio 2019 like IntelliCode support for all of your XAML and C-Sharp and some brand new previewer and Android Hyper-V emulator. And we also sped up our remote at iOS simulator by 300% which is pretty awesome. And here I'm on a guest network at Microsoft and it works perfect. Of course you can join tons of developers and companies that are building applications with .NET and Xamarin today. We love all of them. When you head to .NET and tap on mobile you'll see a customer showcase page highlighting amazing developers around the globe building applications with .NET and Xamarin. So to recap, beautiful applications for just about anything you could possibly think about with Xamarin while sharing all of your C-Sharp and .NET logic with existing .NET applications for any platform that you possibly want. Use all your favorite libraries, JSON.NET, Refit, Poly anything out there, .NET standard enables all of it across all these platforms. You can share native APIs with Xamarin Essentials share native UI code with Xamarin Forms and of course great new features like live share support and telecode previewers and the iOS remote simulator. You can get everything by just going to visualstudio.com installing, you can snapshot this right now which is going to give you a link to Xamarin and Xamarin Essentials and the GitHub project with this code right there which is awesome and links to my show here on channel nine five minutes, 25 minutes, did it Seth. I'm so excited. What? Wow. You are like on the button. Pretty good. Fantastic. Let's go through some questions. I'm ready. All right, number one. Are there any new features in VS related to Xamarin such as stability of connection to the Mac, PR project build, performance improvements and other stuff like that not the getting started with Xamarin Forms for newbies on the new VS launch. Few things. So the first thing is that we reduce our installation size of the product by 20 from 23 gigs to seven gigs which is huge. We have spent a ton of time helping Android build and deploy times. So what we've done is every single release and especially with Visual Studio 2019 you're going to see drastic, drastic, drastic improvements. The first build may take a little bit more time because you're doing a full compilation but iterative builds are seconds, not minutes anymore between projects. Now if you add a new NuGet package or things like that but if you just make a change to XAML boom it keeps going right away. We've also spent tons of time on stability and updates especially around bin and OBJ files. So there should be a thing of the past hopefully and of course things just like getting the Android emulators running, speeding up the iOS simulator and of course that connection to a Mac should be super rock solid. I do it right here on the Guest Network at Microsoft and there are thousands upon thousands of people on that network right now. Right now. And yeah, it's all real, it happened. Right now, they're everywhere. They're everywhere. Next question from Mick. Would it be possible to run on a remote iOS simulator using a Mac with a virtual instance of Windows running? Well, I don't know exactly about that and how that may break Apple's ULas for developers but there are great partners such as Mac Stadium and Mac in Cloud which have Visual Studio for Mac up there. All you need is an IP address to point at your Mac machine from your Windows and boom you're good to go. It talks over SSH. You need to do the right thing though. Do the right thing. Do the right thing. And of course it integrates into like Azure DevOps app center so you can do builds and get it on your phone. Fantastic, truth is singular which is the picture of a puppy dog. I love dogs. I mean, I feel like this is truth. Yeah. Since the Android emulator runs on Hyper-V I will assume that the same restrictions as Docker and therefore can't run VMware at the same time. Can you run, can you run not in Hyper-V? Oh, absolutely. So the thing is before this brand new support for those Android emulators running on Hyper-V is that you had to install Intel Haxom x86 emulation and you had to turn off Hyper-V but you can run your Android emulators with that or with Hyper-V it's up to you. And some machines don't even have Hyper-V or perhaps their AMD processors. So we now support that and we're working closely with the teams when we release updates to Windows to make that better and better and better especially around security and the lower level stuff that Hyper-V runs on every little, every patch. Fantastic. I love to do what makes you happy answer. Yeah, you do you. You do you. Next question from Dan. What's the limitations of the new Xamarin.preview? Yeah, so the preview or part of Visual Studio will show up your iOS and Android apps. I showed Android on Windows because to do iOS you're gonna have to have it connected to a Mac and on Visual Studio for Mac you could do both. We've done a lot of optimizations there. So out of the box you no longer have to compile your code. It just shows your XAML. It won't try to run your code. Won't try to run your code behind. Won't try to run your custom controls. We talked to developers, a lot of developers and what we found is they just wanted a quick and easy preview of just about what my application will look like. It didn't need to be pixel perfect because there's so many different devices. Now you can select a few different device form factors you know, pixels and different versions of iOS and Nexus devices and things like that. You still may run into some limitations like if you try to run, you can opt in to run your custom code but if you try to make web requests or do crazy low level things on your machine like that's gonna break. So you can turn that off though. You can opt out of that which is the default. So you can kind of flip the bits back and forth but we have updated documentation on docs.microsoft.com. So take a look for that. Awesome, rapid fire because we're running out of time. Does Xamarin Essentials now provide an abstraction layer over the iOS, Android, native mapping functionality? Absolutely, yes. It's towards iOS, Android and UWP. It's included in every single template inside of Visual Studio 2019. It's completely open source and available in GA today. All right, rapid fire is a material visual available for Xamarin iOS without forms. Absolutely, you can grab the package called like material iOS. You can tweet at me afterwards but it's available on Nougat. How do I add a UWP project to Xamarin Forms solution? We have great documentation. You just add a UWP app, add the Xamarin Forms Nougat, configure two things, boom, done. Man, we're getting it done. Is there built-in support for dotnet embedding using Xamarin? Yes. Embeddonator 4,000, is it 9,000 now? I don't know. 18 billion. Is hot reloading on the roadmap for Xamarin? Great question. Nice. We have more events coming soon. Awesome and so we're gonna finish with that. Thanks so much James for being so gracious in coming in. Thanks for having me.