Introduction to Xamarin for Visual Studio 2017

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm so excited to be here this morning with everyone to give everyone really kind of a full introduction to nollie xamarin but also xamarin for Visual Studio 2017 and some of the brand new productivity tools built right individual Studio 2017 the Dameron developers can take advantage of today to be really awesome we're going talk about some c-sharp seven features some brand new powerful refactoring tools some brand new templates whole bunch of good stuff for examine developers now if you don't know who I am I'm James fountain magna I'm a principal program manager on the mobile developer tools team here at Microsoft I live in this bright sunshiny city of Seattle Washington and I moved here six years ago actually to become a mobile developer and I fell in love with xamarin started working for salmon over four years ago and now I'm here at Microsoft really enabling developers to really leverage all the amazing tools with visual studio and xamarin to build native apps not only not only do I build awesome apps all the time but I drink all of our coffee and building those applications my favorite part of my job is getting it all back so open sourcing all the libraries and apps I create now you can find me anytime after this webinar you can email me directly matza Microsoft comm or find me on Twitter at James Mountain Magna that's probably easiest way to get a hold of me but I only have a few more ways that you can listen to me after this this webinar so if you want to hear some more samer and goodness two different ways I actually do a podcast called merge conflict you can go to merge complex fm the weekly development podcasts that I do with my good friend Frank Kruger we're a little bit more visual I actually have a show on channel 9 which is called the xamarin show very very straight to the point it's a show about xamarin it comes out every single week and you go to xamarin show comm all sorts of good content on there as well so let's get into it today we're going to do a few things I'm going to do kind of a getting started with Visual Studio 2017 like what's change there's a lot of brand-new enhancements in just the installation process we're going to take a look at vs 2017 and what how to get started with xamarin and of course we're going to take a look some brand new productivity improvements now towards the end I'm going to kind of recap all the announcements from the Visual Studio 2017 launch give you some resources and we'll do some live Q&A as well now don't worry because this webinar is recorded so if you have to drop off at any time like we kind of mentioned earlier it's ok it will send it out to you so let's get into it when you think of Visual Studio there's a whole suite of different IDE s and tools for developers I like to put all this on one side and I really like how they do this is a Visual Studio family and I'll be focusing on Visual Studio 2017 on the PC side of things but we also have tools for every single platform kind of every developer no matter where you're at so we have Visual Studio format which we'll talk about a little bit at the end VL code which is a rich text editor with some really cool awesome tools in it of the brand-new Visual Studio mobile Center which is kind of your one-stop shop Mission Control for your mobile applications and of course visual studio team services so kind of every single thing in the DevOps and source code you know repos that you need are all there and when you combine this all with Azure you really have every single thing that you need as a developer for your front-end your backends everything like that now of course we announced the general availability of Visual Studio 2017 so you can just download it install it you're good to go and you can get it by going to Visual Studio calm so when we talk about Visual Studio 2017 there's some really core fundamental pillars I would say that were focused on first are kind of the fundamentals so getting started opening things opening files opening projects editing projects essentially the fundamentals to get started and additionally a little bit more than just you know the IDE the code editing experience self kind of the fundamental fundamentals of being productive how can we help developers be more productive every single day of course with any single front-end you need a back-end and that's where Azure and our cloud integrations and brand new services for creating web applications and Azure integrations come in of course mobile is what will really kind of focus on today so building native applications with xamarin and Visual Studio and of course DevOps I talked a little bit about visual studio team services and mobile Center so kind of how we're off DevOps solutions for every single developer no matter how you're developing so I want to get right into it I don't always too much time I want to just kind of show you where to get started with xamarin for visual studio how do you get installed on your machine Before we jump into some more complex down those so we're here on just on my desktop and when you go to install Visual Studio 2017 you're going to get this installer this is the brand new unified workload installer so what we see here is that we have Windows development so I've selected uwp and dotnet desktop development we also have asp.net as your data if you wanted to do office or nodejs development it's there rather than removal is that when you're where you're going to select mobile development with dotnet that's all your xamarin goodness in one place now on the bottom I've also selected Visual Studio extension deployment and dotnet core support here now these are what I installed and when I install this this was about 30 or 40 gigs of data cuz it's like all everything under the hood now if you don't select anything you'll kind of get a core development shell of a visual studio that only takes about like five minutes to or four or five minutes I want to say to install the nice thing is when you modify it here which I've just launches the Visual Studio installer which is an actual desktop app here I can modify it at any time so actually what I did here is I went into this which is the Installer hit modify it queried my machine and I can add and remove workloads at any time which is really really awesome so this actually my entire installation took about 30 minutes which is crazy impressive you've ever installed visual visual studio before you know you have to wait a little bit with all these workloads I was able to download and install everything in under a half an hour and get everything I need for my development space set up so once you have this installed then close out of this installer you're going to get Visual Studio 2017 there it is this is your brand-new getting started there's some developer news you can pull out I've also installed some extensions here so if I go into tools extensions and updates' I'm going to pull this dialogue we can see that I have installed a few things let me go to my install here I've been called the Android key source signature tool the editor config which I'll talk about in a little bit and the github extension so it's really nice is when you go ahead and have like github installed it will go out and it'll authorize here I can go ahead and go down to my account and if I want to get one of my projects I can download clone it and it's going to start in by pulling out the team Explorer and downloading everything right away now what I love about this is that once I've cloned the actual solution this is this little coffee cup application that I have is that this is actually in a folder view so right here it just pulled up the entire artwork so I could actually open the readme file that's here and there it is which is really nice so I get this little thing here with all the markdown kind of highlighted but it's not like launching my solution but it gives you this nice overview of my my project and if I wanted to I could just double tap on the solution and then that's going to open up the solution right inside a visual studio so it's kind of a nice experience I don't have to leave the IDE to search whether I'm on CFS or on V fps or on github all of my projects and everything like that are in one nice place so I'll go ahead and let this spin up and one of the huge huge improvements that comes with Visual Studio 2017 was actually how fast I loaded all these projects uwp the backend project UI projects all that stuff and we did a video of well this is a little bit smaller but of a of a 2015 versus 2017 installation side-by-side of actually opening Rosalind which is a humongous humongous project so let me go ahead and show you that video really quick just going to go and launch it here so on the left hand side we have Visual Studio 2015 and the idea is how fast can we get to actually opening the project and searching the code so on the right hand side we have Visual Studio 2017 and by I think like second 1415 it's already loaded 153 projects and I'm searching for a file and boom it's loaded in 18 seconds well in 2015 it's still like looking and we've been install accessibility tools and it's loading the projects and it takes over 30 seconds I think in some aspects like 35 retailers initializers coming through and if you're a salmon developer you're you know or.net developer you like having large projects with a lot of stuff yeah so it's like oh jeez 40 45 46 seconds at this point so just how much time we've shaved off of just actually opening a project it's really bananas of the speed improvements that are in there so knowledge is opening the projects but adding the project and of course it will import all of your past preferences in your ID IDE so if your individual studio on multiple machines it pulls everything back and forth so the next thing I wanted to talk about was like how we've gotten started installed xamarin for visual studio and what the xamarin bring to the market so I want to do a brief overview of how xamarin works how the tooling is and we're going to start building out some applications and show you some templates in the IDE and what's brand new so over a year ago just a little bit over a year ago samer enjoying Microsoft to really help bring native cross-platform development in c-sharp to every developer all over the world and since then we've done some really amazing things as Microsoft and visual studio and xamarin all together and in fact there's just so much that has been going on since we joined Microsoft we've not only open-source olive xamarin forms our Android iOS all of the xamarin iOS Android has all been included in visual studio so there's nothing else to purchase or anything like that so even Visual Studio Community Edition it's all built in that in all sorts of cool stuff like multi process debugging the inspector Hybrid äôt TLS 1.2 support and awesome ski or sharpen I'm in love with and really this open source has totally done so much so one of the key focuses our dotnet runtime which is mono which has been real icing under MIT and what this is allowed now in the open sourcing of mono but xamarin forms is other companies to really leverage and bring awesome new features in the.net ecosystem so one things that Samsung did for instance is they standardize on a.net core back-end for their Tizen platform which powers 50 million different devices all over the world and they chose xamarin forms as their user interface front-end so you can target all sorts of different Samsung devices we've also worked really hard with other leading companies such as unity which is the most popular game engine out there and help them bring our mono over to the Unity game engine so so soon unity developers will go take advantage of all the good net stuff and start implementing some dotnet standards so a1 library for all which is really great so let's talk about creating five star applications and what we do inside a visual studio with xamarin to do that so for me I fell in love as Ameren over six years ago at this point because it really enables me to create beautiful native user interfaces get access to every single API on the different platforms and of course get great native performance and I've always said it in every single session I think I've ever given which is that truly anything that you could do in Objective C Swift or Java you can do it in c-sharp inside of Visual Studio and and what we really enable developers to do is build the shared c-sharp business logic back-end of their applications so this means all your models you models restful service called sequel databases things are very exactly the same across all the different platforms and then we let you build out a unique user interface and access every single API for iOS Android and Windows but you're sharing the bulk of dotnet that's there now for the user interface part we have two approaches with xamarin native approach which again is sharing that business logic back-end but you're creating an iOS storyboard Android XML file and windows sam'l file for the user interface but all the all the logic and the code behind those files is all c-sharp you never have to write objectives to your job everything is in c-sharp by every single API and I'll talk a little bit about how that works and then we have xamarin forms which sits on top of xamarin native and enables you to build a shared neighbor native user interface so what we did is we abstracted common UI controls across iOS Android and Windows platforms and you build everything in easy amyl type markup and then so we don't lose that that native goodness we lay down native controls and that's what is rendered so nothing nothing at all is drawn it's the native control that is laid down but of course it's a abstraction which means that is kind of a subset of what's common across all the different platforms so xamarin forms is really great for a lot of different applications you can see here a few applications that are made including the open sources all that that I built but enterprise applications conference applications coca-cola use it for their iPad application for when their field services are out in the market you know bending the machines and updating the machines so there's a lot of different use cases for it and a lot of developers ask me like which one do I pick and I think with xamarin native the first approach here you're always getting that one-to-one performance with a native language application so if you need your application to start in sub 2 seconds or sub 1 second you're doing lots of images and you need to worry about compression you've custom animations and rent you know custom controls and all this stuff it's a good idea to go down this route and I've always recommended to learn the basics of iOS Android and of course windows before moving to something like xamarin forms so but you know both are great approaches and we recommend kind of walking through the different approaches and prototyping to see what works best for you let me talk about how it works now they've kind of talked about xamarin I think it's a Windows developer we're used to essentially having all of that available to us we have gotten out on the bottom here and and if I wanted to go to uwp or asp.net or something like that I would download an SDK and I would essentially get some brand new namespaces associated with it and you can think of it exactly the same one I want to go to Android or iOS with xamarin so here are all the Android namespaces on top but all that dotnet goodness on the bottom so we have all that Android goodness on top every single API and C sharp and then we have all of net on the bottom so xamarin first brings all done that of course to Android and iOS now is it's really a huge advantage here is you get all done net running natively on the different devices so with our dotnet runtime but you get those c-sharp bindings or every single API an iOS and Android so we add C sharp features like a single weight events land as delegates things that we know and love as C sharp and dotnet developers and we're able to leverage amazing native performance across all the different platforms so on iOS we do a full ahead of time compilation we take your C sharp compile it down into IL and intermediate language compile it one more time into LLVM byte code and send that through an l vm compiler and optimizer so really at the end of the day what's important to us as developers is that we get a native arm binary running natively everything's ahead of time compiled which is really great for our users your users go to an app store they download it they have no idea that it was built to as Amerind or showed day it's just a great app that you built same thing on on Android so you we we actually do a just-in-time compilation and run our runtime side by side the dalvik our art runtime on Android and again the nice thing here is that xamarin application is native so once you have your application built inside a visual studio where you go through the same publishing processes that you know native language iOS or Android developer go through and publishing it right to the app store or distributing it in-house well it's great as always always offer same-day support for for for iOS we've been shipping same-day support for iOS and tylose five and we've gotten really really close on android usually Google doesn't have too long of a development time before releasing and often Android we have a little bit of time to wait on iOS it's really important to make sure you're testing and doing all that stuff on your devices because on day one of like iOS 10 the first week or two 50 60 70 % of all users upgrade on Android I just checked to yesterday I think on the Android dashboard which is Google's dashboard of compatibility and things like that 2.4 percent or something like that were on the holiness version of Android so you got some time but we already have support for the latest version of Android 7.1 and of course the new support for all the iOS dot releases but to me it's always been about more than phones and tablets I think there's something really unique about Dameron and why I really love it is that I can target any single device no matter what it is so if I want to create an watch application or Android wear or Target any of the Amazon fire devices like fire TV or or the fire tablets or even Apple TV applications I can do that with xamarin all in c-sharp now I'm really excited because how we're going to share code is really going to transform we're essentially unifying the dotnet framework and this is a kind of a not a huge fan of this diagram but it but it kind of gets the point across is that whether in building applications in xamarin or I'm using dotnet core and asp.net core I'm building a WPF or WinForms application I'm just building applications and what I want to do as a developer is essentially create one library with a known set of API s that I can share across any implementation of dotnet no matter where it's running the Venge of stuff works and I can use Visual Studio I can use it on the Mac if you use vs code I can use command line it could be built anywhere it could be published anywhere this our kind of unifying the dotnet platform together now what's really exciting is inside a visual studio we're really enabling developers to write code faster with a lot hike higher quality we're building tools to help be super productive when building applications so there's a lot of things that we've done including in Visual Studio 2017 include the inspector the Dameron profiler the dam reforms preview or the Iowa simulator and and workbooks and templates and all this great stuff and besides just talking about some circles let's actually go ahead and do it and let's build some mobile applications so I'm going to jump over and I'm just going to go ahead and launch a new instance of 2017 here and there's this here we go cool if I want to get started essentially I have a bunch of other projects that I've opened on the left hand side what's nice here is that it actually shows me that I've in the last week or so opened a github project on another machine so I could actually open it there now when I get started you can open projects folders websites I just go down here to this more project and when I do that this is going to bring up the brand-new view what kind of your tried-and-true project dialog but there's going to be new options here so we have dotnet core installed here's that dotnet standard class libraries that I showed you earlier we have new things like androids we have some single view application we have a iOS application here and there's Apple watch there's all the Apple watch two and three applications extensions all these are brand news we're going to do iMessage applications or notification services and photo editing extensions you can do that under Universal you have iOS Universal apps and even have TV OS applications if you want to create a game or an application for Apple TV you can do that right here now when you get started here under cross-platform these are kind of our cross-platform templates will create your shared project or portable class library to share code and you can select if you want to use amber and Rose amber and forms let me let me show you what that looks like here so we pulled this dialogue we see blank application we see master detail and then we see what kind of UI technology I want to create so a blank blank app will just give you a blank app and again select famine native so I'll get iOS storyboards Android XML things like that under xamarin forms I would get two shared amyl user interface for a blank application I can then say do I want shared projects or a portable class library project and what's really unique is under master detail is that I can actually come in and say oh I want Samer forms I want to share project and we realize that every single you know almost every single application out there needs a back-end and we have a back-end called Essure and specifically a service inside of it called Azure mobile apps which helps developers build an online offline data synchronization layer including push notifications and authentication right into their application so when you check hosting in cloud what it will do is it will come in and I'll start scaffolding on my application it will go in and we can see all the different accounts that I'm logged in here with and it'll start to go and find my subscriptions my resource groups and I can create them from scratch here based on the different accounts that I'm logged in with which is really nice there we go there's all this other stuff going on now once I have it all set up I can hit create and it'll go off and it'll scaffold out my project now I want to take a little bit of time though and kind of walk through one that's already been opened up for I've modified it a little bit but I'll walk through some of the changes that are here so when I come into the project let me go and just zoom in over here we can see that I have a mobile app back-end so this is an asp.net application that will run on my my logic my online offline data synchronization that I can push up to Azure I still have an Android I laughs and a Windows 10 uwp application I selected xamarin forms here so I have a portable class library which is going to have all my shared code and I had things like services so I have my data layer that's here I have a inner some interfaces I have my model so here's this item that's in here I have view models and I have views that are in here so if I was to look at the the item detail page for instance we can see we have some zamel up here for xamarin forms let me just show you what this application looks like out of the box here for Android and iOS or sorry for Windows so here I have a few different items that I've added and there's some default ones in here so when I come in I get tabbed view so I have Anna browse and I have a bow and I can hit new and I can say hello BF 2017 and then I'm going to hit save and when it comes over here we can see it's added and insert in the top on Android and come down and do a little pull to refresh here and this is going to go out it's going to talk to my azure back-end there we go personnel - there we go hello Visual Studio 2017 and it's good to go and I'll say come over here and add a new one and I'll say hello from Android Texas I'm not sure when the keyboard wasn't working but it is what it is so now I'll make sure that it's all refreshing up we come over here boom there it is and what that's done is when I deployed that back and it actually created my Azure mobile app back-end there's my my items on the default free plan and it just actually assigned it a local database we can see some of the events coming in here there that are coming in in real time which is really cool now I was able to launch these in a few ways so when we kind of walk through the IDE and I say set Android as the startup project we're first going to notice that we have some new Visual Studio emulators now they do have really long names but they're very descriptive so let me go ahead and point out exactly what these are so we can see Visual Studio Android 23 23 23 so that's the API level and we have arm and x86 emulators x86 emulators are powered by the intel hack some virtualization software the downfall there is of the intel hack some the the sets of positive is that it's a really fast fast fast emulator but it's not compatible with hyper-v if you need the hyper-v emulators you can go and download the Visual Studio hyper-v emulators for Android those are still available but the nice thing here is that in our tool bar I can actually open up the Android device manager which will allow me to specify and create new Android images so AVD is an Android virtual device so maybe it's a bit smaller so these are longer name so you can rename them and create new ones but I can go ahead and hit create and here for instance I could just start creating and targeting newer API levels and for whatever emulators that I have installed a big perk here is that inside of this emulator here which is again nice and super fast so it actually does that Google Play services installed so it has maps and messaging and photos and play games so you can test a lot of the Google Play services right here so it's kind of a big bonus by having this of course you can plug in a device and the device will show up right in the list inside a visual studio now of course when I switch over to uwp and I said that is my startup I can start on a local machine on a remote machine or device or a simulator I can optionally download new emulators for Windows 10 if I wanted to test it on a Windows 10 mobile device now there's one other operating system of course that we want to target which is iOS so when I set my iOS project as my startup we can see up inside of the toolbar there's a few things going on I have iPhone and then I have iPhone simulator now this is connected to my Mac we can see it's green here so a point to pull that up we can see that this is being connected to and talking to our our actual iOS device here so we have my MOT spoke local my IP address and it's connected and that means that it's going to go out and talk to my Mac and here's all my simulators and when I hit debug what it's going to do is it's going to go out and it's going to start to create our and launch a remote iOS simulator for Windows so wait for this to build up there you go build and build and building and I should say here this is again a xamarin forms application I'll make these fonts a little bit bigger - why not there we go so for instance we have that stack layout the description all the data binding going on and the different layers that are inside of it let's go ahead and see yeah there's a remote iOS simulator for Windows and I have a bunch of different applications on it so wait for it to deploy here should be deploying ready give it a second there we go launching application now one of the nice things about the remote Iowa simulator is that it actually gives you full touchscreen support so if you're on a surface book or something like that with the touchscreen you can modify a pinch-to-zoom do a bunch of things like that so here now we'll actually get our our Android there's hello from Android I come over here I can actually type on it there we go say hello from Iowa I'll hit save here let's go ahead and launch the my items application again there we go we can refresh it over here and now it's on a full round-trip and of course here's our Windows 10 application so this is a really nice default template to do cloud enable or not cloud enabled based on which you want to get this application up and running really fast so it kind of scaffolds if you will a full application inside a visual studio and I really like it because you're getting the nice native looks and feels on all platforms so inside a visual studio now there's a few other things that we can do if I set the Android let's say as my start up here I'm inside a visual studio enterprise so there's a few enterprise features such as the remote iOS simulator for Windows our profiler and our inspector those are really nice things that you can do here under analyze for instance you can actually launch the xamarin profiler and what this will do is it will go ahead and deploy the iOS or the Android project since I have it as the start up and then what it'll do it was will go out and actually start a a profiling session right inside the visual studio you can profile iOS and Android applications on both Mac and PCs and oh it's going to close down the application and go ahead and relaunch in so let's give it a second and there's our profiler them now this is nice and and we'll put some links set up something I did as amber and show on this actually with Nyna you can do things like allocations and cycles and memory performance and I could just go ahead and choose and now what this will do is it's going to relaunch the application I can put it side-by-side and I can do things like pause it I can take screenshots I actually give this nice overview of what's taking the most processing and memory inside of my actual app location there we go nice I can go and do my call tree let's actually probably I'm spinning up this will give it some time and we can see what objects are allocating the most space and we get these you know allocations per thread so you can really come in and I can actually take a snapshot so I could do some you know navigation back and forth and I could compare those I could save it offline for later and I can start to go through and do some new performance analysis of my application the CPU spikes it can automatically detect cycle references in the application and help you really a fine-tune your application another feature I really like over here is if I go ahead and launch the Android device again it is a way to actually start modifying and updating our user interface in in real time which is really cool so I'm just going to launch the Android emulator there we go into our device wait for it to spin up I would say there we go so now let's say I was going to go add a new item here I can actually come up individual studio into this live inspector button and when I do that it's going to launch our our Dameron inspector there we go it's going to tell me there's an update available that's good you could close that and what this will do is it will actually make a real-time connection over to my Android application so I'm going to save you inspector and this is going to give us a 3d visual visual ization of our entire project we see we have a window background there and kind of toolbar up there now this is the Android view but we've updated this here to say oh this is the van Rijn forms view so actually get a darker outline here and that's because the background is actually transparent so if I tap on the stack layout on the right hand side we'll actually get a property grid of all the same and form specific properties that are on here so I can actually pull this out there we go we slow it bigger so it's lower res screen I can actually modifying the values here I can see oh this is a perfect color that I want for this back found and I can go ahead and refresh this view and it updates in the view I can come down and tell you you know what I would really like is on this label for instance maybe I really want to make the height request really large and I can start modifying the height request of this in real time so as it gets really big like what is it going to look like when it comes out on the device to and from so you can just are modifying values right inside of the inspector which I love some other things that we have are the the preview of the xamarin forms preview asunder other windows the forms previewer what this will do is I'm going to pull it out here is it will start a live session to actually visualize our page and our example in real time so it's actually spinning up a full render almost like a designer of our application that could be run and what I did is I have the sam'l file open on the left and on the right hand side is the pre viewer so go ahead and let it initialize really quick here for a second and essentially what it's doing is it's running my code in real time essentially here so here I don't actually have very much going on but I could come in and say I would like a new button and we have really rich in telephone so here it's actually going to say hello world there we go go ahead and pull this out to do there we go when I save it now we have hello world over here I can come in and then we'll have another label this is the detail page so it is data binding so I'll say text equals there we go and see we have really rich intellisense right there for all the properties and events that are going on so I'll say VF 2017 is awesome up up up up there we go awesome now I can also start modifying some properties so maybe I want the horizontal options to be Center and I really want the color there we go a text color to be is there an orange area orange perfect so now we can start creating our user and face in previewing on both iOS and Android and go back and forth and we get the tablet view and we can see landscape view of this application to see what it would look like on an iPad or on a phone for instance right here from visual studio now the same reforms previewer is in preview still it's available to all visual studio so if you have Community Edition or pro it's going to be available right there which is really cool now what I do love about this is that this is a full application that's been scaffolded out and it has all the different backends that you possibly could need whereas if I open a brand new instance of Visual Studio we can start to build out a blank application I can show you that experience here so if I was to come in and go into more project templates again I can come in to cross-platform and hit OK I'm just going to open up a new blank maybe native app with a portable class library ahead ok here now we'll see something a little bit different because this is not a xamarin forms applications it's going to be as a more native application so we don't have the user interface inside of zamel it'll all be in iOS storyboards or Android XML files for those specific applications so we'll go ahead and walk around what this experience would look like to start building out applications so give it a few seconds here perfect there we go so now let's actually created our our actual portable class library I have a little my class application a little class I should say is a blank class inside of here where I have some references and I saw my Android and I have my iOS application I could go ahead and add a desktop application kind of uwp application as we scroll down and walk through these applications we can see that we have a brand new thing called connected services so connected services allow you to add some things like an azure back-end cloud storage or office 365 API s which is a really nice new way of doing this additionally just like you would expect for examinate of applications is that here I have a mean Android XML and a storyboard so when I actually double-click on the main Android XML this will open up our Android designer for visual studio so go ahead and let it load up there we go so it's going to load this file and when I pull out the toolbox what we're going to see is all of the Android widgets on the left hand side what the blank application does is it will give us a layout in the designer file it's just like a button that we can click over and over again and they're just a blank application I can browse different themes I can browse Android versions that I have installed and I can simply just drag and drop out you know different widgets that I want in real time into this designer which is really nice same thing is true over on iOS as I have my main storyboard file so this is going to go ahead and open our iOS designer for visual studio so again this is going to be connected over to the max we can see the green check box here just like we had previously and this will go out and it will generate and spin up our designer for visual studio for iOS and what we'll see here is that if I actually pull out my where's my view properties up somewhere so many windows property manager it's probably not what I wanted okay we'll just leave it with the toolbox I guess a property somewhere this way there we go so now we have the same type of application for iOS we have a button that we can click I have all the different controls I can drag and drop is out with guy bombs auto-layout support I'm here I'll just say zoom to fit or think there's 1 to 1 every week and zoom in now we have this full iOS designer pulled right in so if I wanted to change around this project for instance and put in a navigation controller I can come out I'll have this in here I can tweet the the sub and now we can come in so this is the start of my application I'll hold down on control and say this is the route so now it actually updates and it's a full iOS designer built right into Visual Studio 2017 so this is kind of the two different ways of starting a xamarin application whether you're gonna do a blank application or just an Android just an iOS application everything is built right there inside the new templates I also got to show off some new cool enterprise features like the remote iowa simulator the profiler and of course the inspector i'm going to close that down really quick let me jump back over to the spot now as we continue on in our journey of building applications and there's amazing new features inside of Visual Studio 2017 and when we talk back about the fundamentals of how we wanted to improve the first-run experience and improve the installation experience and get developers up running we also want to ensure that as you're building code and developing code that you're able to essentially kind of you'll make it a better experience of debugging your application and getting to where you need to be so we kind of saw is that you know well software development you know we're working in teams we know that kind of we switches like DevOps workflow so we have tools like visual studio team service and mobile Center to do that it's so really important that you know individual productivity itself really matters and that's where the fundamentals come in so if we look at the kind of like DevOps workflow things that we have a code editing the bugging unit testing code analysis and then on the right-hand side is all the stuff that happens after your code leaves and goes off to source control and continuous integration and continuous deployment so kind of all of this stuff has to happen until you can get everything back so all of your unit tests and all that software used to do all these things over and over again so we're kind of thought that maybe we could do better in visual studio 2017 so kind of tighten up the initial cycle in the beginning before we do check-in and how do we how can we improve our code and also catch some issues before we go into production so we shift back here we can actually shift left our development cycle so the idea is kind of building in some experiences in our development process and Visual Studio 2017 to shift that development so if we kind of look here there's a few improvements and edit and continue and be able to use the inspector I think also as we kind of type some things back we have some brand new features called live unit testing to essentially pull quality into the inner development loop so as we're writing UI or unit tests into our application to run them live and also some really new amazing source code analysis built right into Visual Studio 2017 that will help us really improve our source code and unify as a team and I want to mention though and some of the things that we'll pull out here is that all this also leads up to the brand-new version of C sharp which is C sharp 7 the objects labeled a few of the awesome awesome new features such as tuples and pattern matching and out variables and local functions down here you can actually find a reference source of all those brand new features in c-sharp 7 i'm super crazy excited for them here's just a few of them here which is the brand new tuple support so being able to actually output multiple values instead of a single type so I can phases into max min I can create them in this return statement for max min and then I can actually say that this is the range or I can actually return min man min max in this little variable type also pattern matching is really cool because previously with switch statements we could only ever just do integers now we can do real objects and we can cast them in real time and actually call additional methods a guess against them so here I'm passing in a ienumerable of objects I can say is it zero is it an INT and which will automatically caps it to val i can do a sub list and and automatically say when is something in there I'll don't do anything it's null for instance break I also have no idea what it is so let me just actually show you some of these productivity improvements so I have that same project open the my items project here and what we're going to notice is that I want to start to evolve this application a little bit so what I did is underneath the models I have some new things I want to kind of turn into a workout tracker so I have athlete's I have a bike workout I have a workout type that's inside of here and as I start to kind of build out this application I want to make sure that my code quality is high too so I actually have some unit tests that are down here so as I pulled those out what I want to say is that I actually have a test Explorer over here and we can see that it's actually starting to run my application and my unit tests somebody here I have live unit test and I've included it here and as we scroll down we're actually seeing some green checkmarks that this was covered by a test or it wasn't covered by a test inside of here and as we scroll down we're going to see that these are all good but if I go into my models into my portable class library we can actually see that these are actually failing here inside and more importantly we can actually try to diagnose why they're having issues so I can double tap on this failing unit test over here thank you know what's going on so we can see that this was expecting an argument null exception let's go ahead and just debug that selected test and this is kind of I like to show this off of some of the new visual studio features because at this point I could be WD be debugging any application it could be iOS Android on this case a unit test application project so we're going to see down here is that we've run into a null reference exception and is the first thing that our brand new exception handler is telling us is that the today's workout notes was null so the length here was causing the issue which is no good at all so I can get details but it actually shows me writing the except I don't need to guess anymore I can actually add that right here so I could actually say well let me see my notes and let me see find all references that's to bring up my notes references here and it's actually gonna show me all of the areas that this is being used so here is the actual constructor of the notes equals notes so that's probably where I want to solve it but in the notes references I can come in and I can say show me in group by project definition or definitely I don't have to guess where and what file it's in or what project it's in I don't want to modify any of the tests I want to modify the source code here I'm going to stop debugging and now what we can do is we can say well if when you go in here and say if notes equals equals null there we go I'm just going to say the row and the first thing that we'll note notice down here is a new and when I hit space we're going to see that down here in the grouping is I have some brand new things such as classes and structures and unions so I can actually find two Mnet's I can say only show me the exceptions that are here and I'm going to say a and E a null argument argument no exception so B by using the casings here I can come in and say let me see it's a name of the note attribute there we go now what's really cool is that it's actually going to start to rerun all of my unit tests and we can see that it's actually going to start to rerun these unit tests and it's going through them here one at a time as I start to modify this code it'll actually show me that I can improve this code we can see a few things so you see these little dots that are here well it's cool all right so the first thing that we're going to notice is that we have these little dots here that says hey you know you can actually throw and you can suppress things and you can throw something because that's grayed out here because there's some simplified chucks I can do but as I was building this application those that units halves went to green I didn't have to rerun it or do anything but look at the actual test that was failing before I double-click on it there it is let me see that this is here we do have some things that aren't being covered so we probably want to fix that up but I'm actually doing in here if I go ahead and refactor this and say throw a new argument exception you see that it knows that it has to rerun some of the specific tests that's not going to rerun all of them but now when I go ahead and save it we'll go ahead and start re running my live unit test as I execute code which is crazy it's really cool so I've already shown comes the new null exceptions that are going on live unit tests that are going on as I write my application but I can go a little bit further in this application now that everything is all green so if I kind of come into my athlete class over here as I'm starting to build this out we can see a few things that are going on in here the first thing I want to point out is that we have these little little dots that are going on and I can hit ctrl dot and then we'll bring this up and it says use explicit type instead of var which is interesting that it's recommending that to me and the reason it's recommending it to me is because we've implemented an integrated in Visual Studio 2017 this thing called editor config so if I could say ctrl T and I say editor config means there's a bunch of editor config files in this application we want the one that's in the shared code so this is a way of describing what all of my team's or my projects infrastructure in naming styling should be so here for instance we can look at VAR so here's the VAR things that we have and we want those to be true we always want to use var so we can come in and we can say make that a suggestion or if we want we can make that a warning if we wanted to a little make it a suggestion for right now and if I come back into this class we'll have the green dot or the little dot again and I can control dot I can say you know control dot use use bar again we can also see that inside of this editor config we have this little green squiggly and we can see that and there's a violation here that it should actually be tweet today workout so someone has named that incorrect so boom I'm improving my code quality as we go through additionally though there's some brand-new c-sharp seven features that I can highlight so the first thing that I'm doing is I'm I have a little tuple here of the workout and calories that I may want to put into the application so I can say get weeks best workout and it's going to return a new tuple to me now what we can see that I used to have to use item one and item two but now inside of here I can actually say dot calories that are being returned instead of item one I can come in and say use the explicit type of dot workout so this is a way of reusing brand-new features inside of Visual Studio 2017 to refactor code but it gets better because if I come inside of here we can see that I have this athlete class in this one file when I go into the bike workout class I have a whole bunch of different classes inside of here I have a workout type I have a distance workout I have a bike workout and what I can now do is say control dot and I can extract classes or files so this is just a standalone workout so I'm going to say control dot and I'm going to say move this entire type out to eight of a new class by that name so there we go it's gone over here we have a workout with all the the namespaces that I need everything is correct I can easily go ahead and start modifying this code and extracting code using kind of these brand new really impressive features of Visual Studio 2017 so some brand new c-sharp seven features some lives tests that are being run and some brand new refactoring built right into Visual Studio 2017 now to kind of break things down a little bit further and talk about some of the other announcements that have now that we've seen how to build some applications with xamarin how to leverage some new features of Visual Studio of course you can get that by going to visual studio comm like I mentioned earlier what's really great with Visual Studio 2017 is that we've worked with tons of launch partners to launch over five hundred extensions inside a Visual Studio 2017 you can take advantage of today on top of that for visual studio enterprise subscribers there's some brand new features and value to the enterprise subscription including a full year of Pluralsight 25 seats to office 365 dev compare us often White's or subscriptions as well but don't forget if you don't have enterprise and you may be on the Visual Studio dev essential program there's some brand-new and really awesome features that you can get advantage of there's a three-month subscription dobson ility for Azure and DevOps training you also get some additional xamarin university training classes as your credits and so much more if you don't have Visual Studio dev essentials you definitely want to sign up for it you can go to aka.ms/offweb Mac preview for this is your brand new IDE for visual studio work for mobile-first cloud-first scenarios on the Mac so you can build xamarin asp.net cornet core applications right from your Mac which is really awesome and we also even announced as part of the family a brand new preview of Visual Studio Mobile Center really enabling developers to build apps really easily deploy them build them deploy them test them and get backend services and crashing and analytics easily across any application written in any language you can go to aka.ms/offweb Center to learn more and hopefully you've seen how Visual Studio 2017 and xamarin together samer for visual studio together enable you to improve on building apps faster and fun and enjoyable as we've improved the fundamentals connecting to the cloud easily easier and even putting some DevOps into your normal coding flow as you will you can get started today by going to Visual Studio comm to download Visual Studio or xamarin comm to read all the great documentation all of this code including the new work out features and things that I've added that I showed off are available on my github and of course we did an entire suite of videos in micro videos about all the awesome features in Visual Studio when you go to launch Visual Studio com I want to thank everyone for joining the webinar of course you can email me anytime and tweet at me as well and definitely follow me on my podcast and development show and with that I'd like to open it up for a little Q&A
Info
Channel: Xamarin Developers
Views: 203,525
Rating: undefined out of 5
Keywords: xamarin, visual studio, vs code, intro to xamarin, programming, android, app, c#, mobile developer, .net, dot net
Id: oyJsc6P8P6s
Channel Id: undefined
Length: 53min 26sec (3206 seconds)
Published: Wed Mar 22 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.