Xamarin: Code Once on C#, Build Android AND iOS Apps | Eduardo Rosas | Skillshare

Xamarin: Code Once on C#, Build Android AND iOS Apps

Eduardo Rosas, Software Engineer & Entrepreneur

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
124 Lessons (9h 54m)
    • 1. Introduction to the Course

      1:43
    • 2. Intro - Welcome!

      0:50
    • 3. Intro - What is Xamarin?

      1:17
    • 4. Intro - Xamarin Test Cloud

      1:55
    • 5. Intro - Xamarin Insights

      2:36
    • 6. Intro - Xamarin Platform

      3:34
    • 7. Xamarin Platform - The C# Language

      3:15
    • 8. Xamarin Platform - Sharing Code Between Platforms

      3:16
    • 9. Xamarin Platform - The IDE to use

      2:39
    • 10. Getting Ready - Downloading the Tools

      2:32
    • 11. Getting Ready - Xamarin Studio on Mac OS X

      1:21
    • 12. Getting Ready - Installing on a Mac

      1:31
    • 13. Getting Ready - Visual Studio on Windows

      1:44
    • 14. Getting Ready - Installing on a PC

      2:41
    • 15. Getting Ready - Resources

      0:52
    • 16. Version Control with VS and Github - Getting Ready

      3:35
    • 17. Version Control with VS and Github - Sync from Visual Studio

      7:01
    • 18. Version Control with VS and Github - Sync Code to Mac Computer

      4:07
    • 19. Version Control with VS and Github - Syncing from Xamarin Studio

      3:20
    • 20. Version Control with VS and Github - Sync with Github

      3:33
    • 21. Intro to C# - Hello World

      6:00
    • 22. Intro to C# - Variables

      5:25
    • 23. Intro to C# - Casting

      3:11
    • 24. Intro to C# - Methods

      3:02
    • 25. Intro to C# - If Statement

      7:32
    • 26. Intro to C# - If Else Statement

      8:59
    • 27. Intro to C# - Switch Statement

      4:03
    • 28. Intro to C# - Object Oriented Programming

      9:19
    • 29. Intro to C# - Asynchronous Programming (async)

      6:32
    • 30. Intro to C# - Asynchronous Programming (await)

      8:14
    • 31. iOS with C# - Creating an App

      3:48
    • 32. iOS with C# - Defining the UI

      4:13
    • 33. iOS with C# - Coding the Functionality

      8:12
    • 34. iOS with C# - Details

      5:13
    • 35. Android with C# - Creating the App

      6:11
    • 36. Android with C# - Coding the Functionality

      6:34
    • 37. Android with C# - Running the app on the Android Emulator

      3:25
    • 38. Challenge 1 - The Problem

      2:30
    • 39. Challenge 1 - Define the UI

      2:11
    • 40. Challenge 1 - Code the Funtionallity

      7:46
    • 41. Challenge 1 - Final Touches

      2:17
    • 42. Navigation on Android - The UI

      4:56
    • 43. Navigation on Android - Coding Navigation

      3:24
    • 44. Navigation on Android - Testing On Xamarin Android Player

      4:01
    • 45. Navigation on Android - Passing Values Between Activities

      6:31
    • 46. Navigation on iOS - The UI

      4:12
    • 47. Navigation on iOS - Navigating Between View Controllers

      1:31
    • 48. Navigation on iOS - Passing Values Between View Controllers

      4:41
    • 49. Lists on iOS - The TableViewController

      3:05
    • 50. Lists on iOS - Abstraction into a Class

      3:57
    • 51. Lists on iOS - Populate the TableView

      4:55
    • 52. Lists on iOS - Creating a Custom TableViewCell

      5:43
    • 53. Lists on Android - The UI

      8:26
    • 54. Lists on Android - Creating a Custom Layout for the Cell

      2:26
    • 55. Lists on Android - Creating a Custom Adapter for the Cell

      9:26
    • 56. Lists on iOS - Details Page

      7:55
    • 57. Lists on Android - Details Page (UI)

      3:49
    • 58. Lists on Android - Details Page (Code)

      5:37
    • 59. Challenge 2 - The Problem

      0:50
    • 60. Challenge 2 - The UI

      1:59
    • 61. Challenge 2 - Link With ViewControllers

      6:51
    • 62. Challenge 2 - Adding Contacts to the List

      4:34
    • 63. Challenge 2 - Listing the Contacts on the TableViewController

      5:29
    • 64. Challenge 2 - Contact Details

      4:06
    • 65. Challenge 2 - Image Picker

      5:09
    • 66. Challenge 2 - Sending Emails

      4:44
    • 67. Sharing Code - Shared Project

      3:22
    • 68. Sharing Code - Defining the UI

      1:49
    • 69. Sharing Code - Code the Functionality

      3:52
    • 70. Sharing Code - The Mighty Shared Code

      7:13
    • 71. Sharing Code - Accessing Shared Code from iOS

      9:24
    • 72. Sharing Code - Accessing Shared Code from Android

      5:44
    • 73. Challenge 3 - The Problem

      1:42
    • 74. Challenge 3 - The UI

      3:24
    • 75. Challenge 3 - The Shared Logic

      8:04
    • 76. Challenge 3 - iOS Specific Logic

      9:24
    • 77. Challenge 3 - Android Specific Logic

      3:11
    • 78. Mobile Cloud Services - Intro to Microsoft Azure

      3:34
    • 79. Mobile Cloud Services - Portable Class Libraries

      7:27
    • 80. Mobile Cloud Services - Creating the Mobile Service

      7:50
    • 81. Mobile Cloud Services - Facebook Login (Creating the App)

      6:15
    • 82. Mobile Cloud Services - Facebook Login (App Logic)

      10:58
    • 83. Mobile Cloud Services - Inserting to Cloud Database (Android)

      9:34
    • 84. Mobile Cloud Services - Inserting to Cloud Database (iOS)

      2:21
    • 85. Mobile Cloud Services - Reading from Cloud Database (iOS)

      6:09
    • 86. Mobile Cloud Services - Reading from Cloud Database (Android)

      5:27
    • 87. Mobile Cloud Services - Displaying Details (iOS)

      2:42
    • 88. Mobile Cloud Services - Displaying Details (Android)

      1:35
    • 89. Mobile Cloud Services - Best Practices

      6:15
    • 90. Better iOS UI - Constraints

      1:36
    • 91. Better iOS UI - Adding Constraints

      4:30
    • 92. Better iOS UI - More Constraints

      4:35
    • 93. Push Notifications - Keychain Access

      2:43
    • 94. Push Notifications - Creating a P12 File

      4:11
    • 95. Push Notifications - Uploading Certification to Azure

      1:25
    • 96. Push Notifications - Creating Provisioning Profile

      2:03
    • 97. Push Notifications - Get the App Ready To REceive Push

      2:38
    • 98. Push Notifications - Register for Notifications

      9:18
    • 99. Push Notifications - Register for tags

      4:22
    • 100. Push Notifications - Testing Push Notifications (Debug Mode from Azure)

      4:00
    • 101. Push Notifications - Backend Logic

      5:18
    • 102. Push Notifications - Working with Tags

      7:57
    • 103. Challenge 4 - The Problem

      1:31
    • 104. Challenge 4 - UI Design

      4:37
    • 105. Challenge 4 - Hiding the Navigation Bar

      3:34
    • 106. Challenge 4 - Changing Navigation Bar Color

      3:06
    • 107. Challenge 4 - Making UI Items Round

      2:14
    • 108. Challenge 4 - Connecting to a Mobile Service

      3:50
    • 109. Challenge 4 - Creating a Facebook App

      2:01
    • 110. Challenge 4 - Getting the Facebook Username

      4:54
    • 111. Challenge 4 - Login with Facebook

      7:40
    • 112. Challenge 4 - Get User Data

      6:09
    • 113. Challenge 4 - Getting Facebook Profile Picture

      6:38
    • 114. Challenge 4 - Displaying User Information

      3:29
    • 115. Challenge 4 - Uploading Items to Azure

      4:52
    • 116. Challenge 4 - Displaying Posts on TableView

      5:45
    • 117. Challenge 4 - Posting to Facebook

      6:08
    • 118. Ultimate Code Sharing - A Windows Desktop App

      3:01
    • 119. Ultimate Code Sharing - Changes to the Backend Logic

      1:58
    • 120. Ultimate Code Sharing - Making the Windows Desktop app Read from Azure

      7:51
    • 121. Ultimate Code Sharing - User Controls

      10:02
    • 122. Ultimate Code Sharing - Data Binding Wizarding

      9:36
    • 123. Location and Maps - Get Location on Android

      13:50
    • 124. Location and Maps - Get Location on iOS

      13:25

About This Class

Learn the basics of creating both Android and iOS applications using Xamarin, for reusing up to 75% code. Plus, empower your apps with Cloud-based services!

Build Android and iOS apps that are empowered by cloud services with up to 75% code sharing between platforms.

  • The Basics of the Xamarin Platform
  • Learning the C# Programming Language
  • Building iOS Apps with C#
  • Building Android Apps with C#
  • Share code between platforms!
  • Facebook Authentication
  • Cloud-based Databases
  • Facebook Integration

Powerful apps that your users will love

Using Xamarin to build your iOS and Android Apps can save you and your team a lot of effort and money. Think about it, instead of coding two apps, you are coding one and deploying it to both android and iOS. All of the time and money you are saving is just amazing!

Get Hired!

Looking for a job? Picture a company that is looking for an Android AND an iOS developer (as separate positions). Now picture yourself going to an interview and telling the recruiter that you can build BOTH apps in the same time as it would take two people to build them, achieve that by reusing code with Xamarin!

Content and overview

Suitable for beginners or anyone who is barely starting on mobile app development. You'll learn the basics of the C# programming language, the basics of iOS and Android app creation and you'll even create real-world apps connected to the cloud.

Also suitable for experienced developers who want to learn what they can do by sharing code between platforms and integrating powerful cloud services in their apps. You'll learn how you can share C# code between Android and iOS projects, access cloud-hosted databases (and create those databases), authenticate your users with Facebook or other services and more!

Transcripts

1. Introduction to the Course: Hello. Welcome to the summering good ones. You for Android and IOS cares. My name is under the roses on building moral obligations is my life have begun in windows on droid and iris applications for the past four years? Cody wants for Android with Java on another. For IOS with objective sear. Swift is good, but it takes a lot of time in that. A lot of effort. By the end of these courage will know how to create and rode on iris sobs, sharing most of the gold. You will learn the basics of the C sharp languish. You'll have 100 great on Android and IOS applications. Using C shot, you will learn how to share the seizure code between bold platforms. You will learn to implement cloud based services into your raps on many more things. I designed these curves for the mobile developer who wants to build for both Android and IOS as quickly and effective as possible. This is also a great curse for those who are looking for a job. Just picture yourself. You can feel the position often I us and an android developer at the same time, with the same amount off effort. You can kind of, like, get baked twice, right? Please feel free to look at the curse description so you can be certain that these jerseys for you. I look forward to see you inside. 2. Intro - Welcome!: Hello. My name is gonna go process and I'm going to be the instructor for the Gers. I want to welcome you. I want to let you know through things that will be very careful for you throughout the entire occurs. First, police feel free to ask me whatever doubt you have 12 occurs either in the discussions of the lectures or they have a message for you to me. Second, please also feel free to post whatever you warned regarding summering off the discussion. So the lectures this way you interact with other students on we'll learn new things. Whether it's some use that have just come out about summary or the screenshots of your new summering applications, we can all interact and we'll learn together so that for her to do see you inside 3. Intro - What is Xamarin?: Okay, so let's dive in into this summer anchors before we start coating and we start learning how to create android and IOS applications with one single code. We should first understand what Sam Arrhenius saying have a better understanding off how somebody is trying to sold three main problems. So the three main categories were products that Semmering the suffering is the someone Platt firm, the summering test cloud, and someone insides This tree Products from Sam Marine try to fall three things. The 1st 17 platform tries to be a better way for developers to build applications. Summering Test cloud is a better way, according to some Marine, for you to test your applications, and the 3rd 1 to someone incites is a better way for you to monitor your applications. So somebody in sexually trying to solve this three problems with it with this tree offerings for the developers to be more effective when it comes to building testing on monitoring the raps 4. Intro - Xamarin Test Cloud: So we've already talked about the three main offerings that summary Haas. For developers to build the drops, to test better the wraps and to monitor the wraps better. Let's now talk about a little bit deeper about what someone test cloud is. Well, the seven test cloud allows developers to test the raps on over 1000 devices. These are real devices from which they can select from manufacturer operating system. Even popularity off their target market on actually test their abs so they don't need to have so many devices available for day to actually know how it performs in different kinds of devices. Seven. Test Cloud also allows developers to precisely analyze their APS performance so they can understand in a better way where there are bottlenecks or worthy. I B is getting a little flow, and it's very simple because you actually have screen shells and video player back from when your application was running on the device so you can go step by step and see exactly warrior up. He's performing a little bit. Well, not on the positive side. So seven Test Cloud mainly allows any developer to have access to thousands off devices so you can test your obligation in a very different kind of devices. And that works very well known Android since there are so many devices, so you can actually, no. When is Europe not performing good enough? So you may take the right decisions. 5. Intro - Xamarin Insights: So in the previous lecture, we talked about the summering test cloud. Let's no talk a little about the summering Insight service. So someone insides helps developers improve their APs, thanks to real time monitoring so you can actually at real time gonna turn with precise detail error reporting to your applications with a single line of gold. So seven insights provides reporting about crash and issues with your applications. It monitors sessions and users. It is, of course, bill with Dark Net and it's secure and privates, thanks to its precise detail reporting. When you looking into your report, you can actually understand if there were any crashes and the identity of your users. What type of issues on warnings are occurring during your application so you can actually improve your application? It's It's quite simple because when you start understanding, worry applications failing when your application is crashing, it's easier to understand. Wild line of code may have caused that ever someone incites. It's not just about every reporting. It can also help you understand your users. What so Westboro ations they're using which devices they're using, what issues they've been experiencing on what activities they've been using during their sessions, so you can actually understand how your users are interacting with your application so you understand what feature from your application is and what's used. For example, another feature of the summering insights is that you're actually able to easily track and report any event in Europe. This actually helps you notes on Lee to build reproduction steps when a crush a curse, but also lets you investigate exactly how Europe is being used. Finally, you can, of course, connector applications to a variety of external services. Such a scant fire. Get hope, keep shot visual studio line and slack so you can be immediately notified with nature is happening or when an issue is securing repeatedly, and these will help you identify errors much, much quicker. 6. Intro - Xamarin Platform: Okay, so we've talked about summary test cloud. That is a better way for developers to it as the wraps. We've talked about the summering insides, which is a better way for developers to monitor the raps. Let's just start focusing on the summoning platform, which is the one that we're going to be using throughout the entire curse. So someone platform is a better way for developers to build their APS. That's what someone says, and it's actually quite true. You know, with seven platform, you can actually share your code across multiple platforms on by multiple platforms. I mean, I us android windows on dMarc applications. This will all share the same C sharp code base, so you'll be using the same language. The same may be ice the same data structures on each off this blood from you Build an Irish , uh, on up once, and you run it on IOS and android a windows and I am Mark device. Now someone plot from uses. See shark and let me worry you, you may fell in love with C sharp throughout. The curse now would see sharp. You can, of course, do anything that you can do with Objective C or Swift on IOS and Javal Mandroid. And, of course, he Chapman Windows and Objective. Since we've done Mac, the main point is that whatever you think you're able to do with any of those languishes, you can actually do it and see sharp as well. And it's quite simple. And you may think, Oh my God, I already learned three. After I already learned Objective Sear I already learned. Gala, do I have to learn? See chart now? Well, let me tell the little secrets when it comes to programming, it's not about learning a language. It's about learning how to code. Want to know how to code? You can code in any language. You have to understand data structures a little bit about the same tax. But that's why I'm here. I'm going to walk you through all of those things Now with seven platform. Of course, you can't native you I native ap I access on because of these. Your op performs natively because it is native. It has native performance. Now what does this mean? This means that if you create a tax books when you wrote it on an android device is going to look at the tax books looks on an android device on. If you run into an IOS device, it's going to wrong. It's going to work as a textbooks or in this case, text field looks on IOS device. So it's going to have native you are the AP eyes that you have on each of these platforms are actually used. Someone is not creating in the FBI is just accessing the native AP ice. So the performance East Action native because you're actually using those native AP eyes all of this Can't it all be achieved with other solutions? Because most of the other solutions for multi platform development all they do is create HTML Web based applications. And Daddy's never native, so they never have made a performance which you can achieve with Samarie platform. 7. Xamarin Platform - The C# Language: Okay, so we've already talked just a literal about each off the three main products that summering offers submarine test cloud for you to be able to test your application of many devices somewhere in the insights for you to be able to monitor your applications and something platform and summary blood from is actually the one that we're going to be focusing because it's the one that actually allows us to create applications. You see one single code on deploying it to different platforms. So, like I mentioned before, we were going to be using C sharp as language for your mobile app development. And I mentioned that anything that you can do an objective C and slipped for IOS or Java for Android, you can do it on C sharp and in fact, see sharp hasam advantages over those languages. For example, in C Sharp, which have strong types. This means that when we have a collection, take a look at this list off free item. This is a collection off feet item, so having this kid collection, we will be sure that in that collection there's nothing else other than three items, so I don't need to be casting or commenting my code to understand what that list is about because I know what that list has inside of it. Another great advantages language level a sink and facing justice stands for asynchronous programming. So it's in Objective C Street in Java, a synchronous programming request, cool bags and manual bookkeeping. See, Shirt has language level support for a sing programming. That is just amazing. I mean, take a look. For example, at this second method in here, well, I have to do is market with an ace ing operator to make it a synchronous. And when I want to coal and a sing method, all I do is use the away operator to wait for this to end before it moves forward to the next thing. And the will, of course, took about this in more detail becoming lectures. But I'm just giving you a glance of what C Sharp allows you to do another great thing about six copies. First glass function in Java for android land is are just on existing in objective See London Lambda are really, really weird and we'll objective sees weird landless are even worse now in C sharp, Lambda Lambda are just so simple they couldn't be simpler. And I'm going to show you an example of lamb This in the coming lectures. Just so you know how simple using lamb this can be with c sharp. So to sum up in these lecture, really C sharp is amazing. And if you were doubting about a But I don't really know what Jave and you could do this and never will. You can do the RNC sharp as well, I assure you. And the same goes for swift or your objective C. 8. Xamarin Platform - Sharing Code Between Platforms: Okay. So in the previous lecture, we talked about C Sharp as a language for your mobile love development. Let's not talk about how you can share that seizure code everywhere, so we're going to be using the same languish. We're going to be using the same AP eyes and data structures so we can actually share an average of 75% off op code across mobile platforms. This means that we can have 75% code that will work in IOS Android on even Windows applications without doing anything else that's 75% off. Our code will just work. Now, these 75% code could be at logic. Most of it should be ABM logic. What is going to be happening throughout the entire application, no matter what blood from we're in, But it could also be shared. See shop user interface code. So we may find the you I with C sharp. We can, of course, use a designer, but we could use the show to define the user interface, and these would actually improve the amount off Kota we're going to be sharing throughout each of our applications, no matter the platform now At the end of the day, you will also need some platforms. Pacific C Sharp for some very platform and specific features on this could bury from three D touch on IOS or cortana and Windows, or some of the very thing many things that you can do on Android that IOS doesn't allow you to. So these would be platform specific C sharp, because thes are platform specific features. But you can still implement that throughout your entire application and differentiate it depending on which Platham you're running your application into. So at the end of the day, you can finish the developments or of your application and have shirt projects that have the logic or assured throughout each of the projects. The Iowa is the android. Maybe the Windows application. You could have PC else or portable class libraries that exist in dot net for you to be able to share or implement this libraries into each of your projects on, we're going to talk just a little bit about summer informs, which will actually actually allow you to the fine native you. I on actually share up to 100% Koth throughout your entire applications. Nomar of the platform. We were going to be focusing on a summering as a summary for iris summary for Android, and we'll actually be able to share up to 75% code. I will Jaws bitter, finding the the interfaces differently, and we're going to be implemented platform specific C sharp for platform specific features . 9. Xamarin Platform - The IDE to use: Okay, so now we have a very good idea of how we're going to share co throughout all of these platforms, or maybe just the U. S and Android. In our case, let's talk about where where are we going to be building this applications? Well, in the next chapter, we're going to be getting ready for these on were actually going to be using summer in studio because I'm going to be using a Mac and the only way I can build IOS and Android abs with Samarie in the magazines with Summer in Studio. However, we may use visual studio in the future in Windows because we actually can official studio. If you're not familiar with it, well, he's just the best idea out there. So, officials, do you have some great amazing features. The best, when I believe, is intelligence, which just makes life so simple about are completing your code. But there are a lot of features a professional studio that I lof starting with July. It's just I don't know, it's it's it's cold. But, you know, if you have a Mac you're gonna need in seven studio I need actually comes free with with summering in the next Lectures were going to be talking about where you can get summering. Bear with me, but Semmering Studio comes free with Samarie on If you have Windows, you have bowed options. You have someone in studio on visual studio. If you can visual studio, go hang, use its. In fact, I'm going to be explained how to install the summer imploding into visual studio's. You can start developing native IOS and Android applications in visual studio. That's that's just amazing. Um, yeah, that's it. So, without further to do, let's go right C sharp. I'm wrong. Our applications on up to 2.6 billion devices that that's just nonsense. But it xray because we're going to be writing applications in Tallinn C sharp, and this code is going to be shared throughout IOS and Android on. Eventually we could implement Windows, Mac and more and buy more. I mean, apple watch and road, where I'm Windows windows standings just everywhere from your wrist to our gigantic screen to holo gram. So someone in this amazing let's get started 10. Getting Ready - Downloading the Tools: Okay, so now that we have talked about what summering platform is, how I can help you create IOS and Android applications using C Sharp, let's talk about getting summary in Ready in your PC Now for you to actually purchase someone you have to go to store the suffering that calm as a lake. One of these programs Sorry, but don't worry. Don't worry. You're saying a Porteous purchase. What's wrong with song? Don't worry. If you want to purchase, you can purchase an indie version for 25 a month business version for a house in the year or enterprise for 1900 year. But you can always try someone started Vision, which is an amazing a vision of summering for free. It actually allows you to do everything that you can do with summer in. You can build applications for both IOS and Android actually used either summering studio or official studio on your Windows PC. Deploy two devices. It just doesn't allow you to create huge ups. You know, it's very small abs, and it's going to work perfectly for the scars. So if you tell if you are ready to purchase any of these programs, from summary, and you can just go ahead and try the severance tradition on Download It on Your Mac or in your Windows PC. One thing to keep in mind is that the free version of Summering actually combs with Visual Studio 2015. So if you have visuals to your 10 15 chances are that you already have the summering free position. So either you have already downloaded a free admission. Or you have to describe to one of those programs you go ahead and navigate to summer in the come click on Download on. We will be able to download some money for either your Mac or your Windows busy so all it's going to ask for a couple of things about you and you can click on download stammering for your operating system downloads going to start and will just live it downloading in the next lecture. We're going to walk you through the installation of summer in getting ready on your Mac, and we're also going to do it on Windows for you to get summary ready on reaching the studio 11. Getting Ready - Xamarin Studio on Mac OS X: Once your installation is finished, you'll actually be able to go ahead open somewhere in the studio. From this put lights, you can search it through this polite. You just have to press command space. You can start typing summary, and you will see someone's through right there. Now if you go to new solution, you can actually create Chris blood from implication on IOS application on Android application. Or you could even create a dog named application something like council projects or a shape brochettes or even a portable library. And you may not know exactly what the's all is. We were actually going to start working with C Sharp with a consul application. So this is actually the first seizure project that we're going to be creating during these girls. Also, we're going to be checking out will be about portable library supportable class libraries, which will allow us to creates certain packages that will work throughout applications throughout platforms. So we that for there to do in the next section of this, Kurds were going to finally start coding some see chart 12. Getting Ready - Installing on a Mac: So once it download is finished, all you have to do is double click your DMG file or your exit file. If you're in a Windows machine and something like this will pop up, of course it's going to different little bit from Windows Teoh Mark. But you just have to double click these taller and in my task, for some permissions, you just like J. Okay, go ahead and do whatever you have to do, and this window is going to put up off course. You have to read the license agreement. If you agree to it, check on. I agree to the license. Tres Anchalee continue. It is going to tell you which protects Jewish to install. We're just going to be using summary nine years and someone android, so I'm going to uncheck summering Mac Unlikely can continue. It's going to tell me where it's going to install, Likely can continue. It's going to tell me what things are going to be installed will continue and it will start downloading things. I'm going to live this installing. Of course, you can do so as well. It's when you installed the address. This decay. The summer in Studio your I d and, of course, the extensions and product summering android and sovereign IOS for you to be able to create those kinds off applications as well. So in the next lecture, we're going to talk about how to get started with someone studio. 13. Getting Ready - Visual Studio on Windows: So let's no talk about how summering is ready on your windows PC once you have installed both summary just like we did on the mark. And make sure that when you install visual studio you have summering checked. You should be able to go ahead and open visual studio. Yeah, eater, Enter Price or the Community edition, which street Quick. A new project either from start or from file New project, and you should be able to see these we knew right here and to the left side. You should be able to see both IOS and Android options for you to create your mobile applications. Now, this is particularly amazing because I'm a visual studio. That's Microsoft's property, and I actually can create on drawing applications and I US applications. Now these disposable be kills. Summer in is installed on my windows PC as well. Now, in just in case you don't want to build in your applications on Mitchell Studio, you can go ahead and look for summer in the studio, which should be installed on your PC if you follow the instructions and it's going to be very similar off course, somewhere in studio is not as powerful especial studio. Well, the good thing about summer in Studio is that it runs on both Windows and Mac. So there's version for Mike as well as for Windows. And in here you can always create a new solution. And here you will say, if you wanted to be cross cross blood for or Android or just another. 14. Getting Ready - Installing on a PC: Okay, let's no talk about how you can get some Marine into your windows PC. So the first thing that you need to do use download visual studio like I told you in the previous lectures. Maybe the community edition, which is free. Well, you have to do then East. Once the XY file is downloaded, he's double click it, and the installer will actually launched. Now, if you don't have officially, students told, the installer will walk you through every single step that you need to get it installed. Since I already installed rituals to your 2015 I'm going to just modify my isolation to be sure that everything needed for summer. And it's already stole. If you already have actual students told, chances are that if you create a new project, you will actually be able to create an IOS or Android project because summering gets installed with Michelle Australia 2015. So once you see something like this, you may see install because it might be the first time during television studio. But since I've already started, I'm going to click and modify, and you're going to be shown either way something very similar to these if you're starting to install for the first time or if you're just modifying your installation, you see something similar to this. Now what? You have to make sure that you're installing ease on the cross platform mobile development . Um, drop down. You should be checking in. C sharp slash that dot net summering. This is 1/3 party application, of course, because this is from submarine, just make sure that you're insulting it. Another thing that you may want to install these divisions to. The emulator for Android because, let's face it, Google's emulator Fran Druid is is bad. Actually, Microsoft's it's way, way better. You may also want to check on particular Android is the cane that you want to install from assembled this Level 22 a p I that I want to install for my android application development . On the tip, you click next, and in my case, I'm going to click update. In your case, it might just be in store. You, of course, say yes you can. You want to install new things, and that said, once installation is finished, you can go ahead and open visual studio and start creating on droid on iris application 15. Getting Ready - Resources: Hello. You are now ready to start building. Ire s on android applications using C sharp. You're somewhere in the studio. I d east or running stole only their your Mac or your PC. So it's time for us to start building those obligations. Now, before we move forward, I want to let you know that in the research says for the first lecture off each chapter, you will find a link to a give over repository where you will find the source code to the project that we will build throughout that chapter. To go ahead, feel free to dumb awarded. Check the coal. If you have any doubt about harm, Corning it or you feel better by following myself, tell you what I'm doing with my code. Open your PC. Go ahead. It's there for you to use it. However you want 16. Version Control with VS and Github - Getting Ready: during the next videos, we're going to be talking about version control, how you can use virtual control tools such as a visual instituting services, and get hope not only to keep control of the version ing of your applications and to keep your application of saving the clout, but also a way to share a project between visual studio on your Windows PC and someone in studio on your Mac. So I'm actually going to focus or really taking advantage of these tools on being able to code the same project on both your PC or your Mac. This could be very useful along many scenarios. For example, for me, I find it very useful to Seoul only be coating on my PC. And I certainly don't have my PC hot because I'm traveling or I don't know. I took my mark with me boards my perfectly in the clouds, like in just downloaded into summer in Studio and keep coating on my Mac. Or, for example, if you want to be coating on your Mac when you're building the iris application or your Mac application, you can do so checking your changes and then on your PC develop the application for Windows , for example. So there are, ah, a couple of things that I need to do first, and that is to create a couple of accounts. What is going to be a visual studio account on when it is going to be a giggle account to this sexually visual studio team services account, and it's fairly easy to create. Well, you have to do is go to visual Studio that calm, and you will find this big Bolton about getting started for free and visual studio team services. And when you click it, you're going to be navigated to create your own your own repository. So, for example, here I I can create my own costume mural for my own visual studio. I don't know. In this case, I'm going to use something very similar to my to my email, and I'm going to click on Continue, and after a couple of seconds, I'm going to be ready ejected to my own dashboard. So that's just wait for a second, and here I could my dashboard, and I'm not going to dig very deeply into the dashboard boards. I will guide you through the steps needed for you to create your project and store your project here in visual studio. So you, of course, may have some getting started guides. I'm not going to focus on that right now, Boards, I I'm going to move on to create my get home account. So it's really simple. You go to get help that comb on its actually right here, this Heino form. So I can pick, um, user name. And I can use, um, my email account as well and creates on password and saying no. Forget hope, and I am Course I'm going to just use a free repository right now. No need for us to pay for the repository for everything that we're going to be doing. It doesn't require a private, unlimited paid repository. So I'm going to finish the sign up, and here I am. I am. I give repository. So these are the two accounts that were going to be needing to move forward with the next videos 17. Version Control with VS and Github - Sync from Visual Studio: So let's say you have a project like this one on visual studio. You have financial project in the U. S. Project we news project and your shared project. And maybe you want toe on a Mac project. But you can only do that from a Mac PC. Or maybe you just want to use your Mac rivals developments or in friendly development, and you're just going from one B C to the other. The first step that you need to do in order to be able to access this project from other computers, including Mark Mark computers, is to go to your team services to visual studio team services. Now you want to go to the main page of the visuals to your team services, and you can do that by clicking team services from the top left corner and you want to create a new project. And right now I have some order projecting here. It'll give it time to by default, and you want to create a brand new project. This is just some app. I'm not going toward in a description. You do want to make sure that you choose agile as the process temple template and you select, get as a version control. Once the project is created, you can navigate by clicking on the navigate the project. Barton, obviously, And the here is where you will eventually be able to see your code s your workspace. Maybe see the springboard now that you are on a team and you really want to get into finishing the the development process, Visual shooting terraces is quite powerful. The things that we're going to cover are just very, very basic. And it's just going to focus on having the project of a level from the clout so you can use it from your studio or somewhere in studio. Well, there you go. You're perfect. This created the next step that you need to do is hit back to visual studio. Here. You want to go to the team Explorer. It's by default and usually next to the solution Explorer tap. And here you want to make sure that you are connected to Europe Visual studio Team services repository. So you have these outlet, these green outlet Ikon in here that you can press in order to manage your connections. And in here you can select to connect to a team project. Now, here you will usually don't have bitey for your server so you can just click of servers and hanging to your to your account So you actually see all the servers that you have, uh, linked to your account? In my case, I have these server and I have thes predict collections. And somewhere in here is my brand new some obligation that I have just created from the Explorer. And here it is. I see it's connected right now. It's connected to another repository. So I'm going to go on change this, I'm going to select home. I'm going to projects and my teams and I'm going to say the app today actually want. And now I'm connected to that brand new application that I have just created from Mitchell's to a team services. The first thing that I need to do once it's connected, it's to clone the repository. I'm going to select some part my PC where I want this repository to be hosted on so I can actually just go to where everything is stored, everything from visual studio. So I capital Stewart 3 15 projects I can make a new approach a new folder. It's not in here where I wanted to do that. Uh, projects. Create new folder, some repo click OK, and click on Cologne Repository. It's going to be quite fast. And once it's cloned and notice how, if there are no solutions currently, so I'm going to click a new solution. I'm actually going to click on Open Solution because I have the solution already created it . I'm going to navigate to visual studio a pro she ate, and I have the sum up writing here, So I select the solution file. I click on Open. It's going to be added to my repository, so your solution should now appear in the switchers for a just in case it wasn't already there. The next step is to right. Click on the solution and click on Add Solution to Search Control. You will see how some icons appear to left off the names of the project in the names of the files, And that means that is already eats head of some kind of version control the next staying in. The next thing that you have to do is hit back to Tim Explorer and you'll be able to see how, instead of the solution stuff, you can now see that solution as well. Now you want to click on sink. It's right here in the project. Tap on. Right now, we're going to be using team services, so I'm going to weaken get started. I, of course, have to select my my make sure, Like how? Which I just create my visual through a team services account on Guy May need to signing again. Reenter my credentials. If it's the first time you duties, you will have to enter your email as well. It's going to take a while to connect, but after you are connected, you'll be able to enter your account Your l, which in this case is going to be very similar to my email address. I already have the repository name, which is the one that I have created earlier. Notice how now that I've tightening, I can't see my account your l I have actually access to some other account your else and I can publish my repository. And there you go. You will see these notification that the sum up the name of the project Waas published I can actually go see it on the Web. If I hit back to choose to officials to your team services, I should be able to navigate to the Koth top. And indeed see all of the projects that I have. I can click on one of the projects and seal of the files inside of it. And there you go. You already have your visual studio. Proceed reversal. See a solution on the cloud of visual 13 services. So you can now move forward and get that from summering studio on your Mac. 18. Version Control with VS and Github - Sync Code to Mac Computer: Now that we have a project officials to a team services, it's time for us to download that project into a math computer on be able to use it from somewhere in the studio. Remember that from visual studio Teen Services? We were already able to see our project, our code. And now we want to be able to use that code from somewhere in the studio. The first thing that we need you to east to get get into our mark computer. So all you have to do is go to get Dash s c m dot com slash download slash mac on install the get application into your computer, and once it is installed, you want to download to you're a visual studio Team services account. Here, you'll see your apple east it, so navigate to it and you want to go to the coast tap instead of the Koth top. And in exploring section, you will see at Cologne Bolton. Click on it and you will see the clone You're out. Copy the cologne. Your l on opened the terminal. So since gift is a writing stolen your PC, it's very easy to do this. I'm actually going to clone the repository into my computer. The first thing that I want to do is make sure that I am on my tester because that's where I want to. Kumar Repository. So I'm going to yeah, the city into Might that stop and I'm already entire Might that stuff? I am not going to create any folder inside of here. I am just going to get clone and my repository. So I'm going to click on Enter, and that's it. That it's it's I'm actually going to navigate to my test or from the finder. I have it right here. I have my desktop and notice how I have here this home up on. I have all of my projects, including the solution which is already identified as a file that can be opened with summer in studio. Now, right now, I was expecting, um, get hold the terminal, tow us for my credentials. The thing is, I might have already insert them earlier, So if it asks for your credentials, make sure that you go to your profile. You go to the security tab and you select alternates authentication credentials. You hear you want to create a user name and you want to create a password in case the terminal asks for your credentials. These are the ones that you want to enter. So that's right. I'm I'm not going to double click the solution. It's going to open summer in studio and, well, that's it. I'm actually able to have both seven in the studio and visual studio on Mac NBC with my very same solution sharing the project off course when those projects can't be opening here . But there's how I have my PC and I have my 100 project, and I can, of course, open this and change this and checking the changes on all of these changes are going to be uploaded to the cloud. So of course, I can download them from visual studio on the other way around as well. So this is quite great to be able to use these Boats IV's seamlessly without really caring about losing and memory Stig or or not having the project off updated all the time. So there you go. That's the way you can use someone. Studio unusual the studio at the same time with the same project 19. Version Control with VS and Github - Syncing from Xamarin Studio: now, once you have your project opened on summer in the studio, you can actually make the changes in here. Checking the changes on off. Usually download those changes on visual studio if you go back to your PC Now, when you first opened the application, you may. Nobody's these. I can on the iris project that he says that it is not build an active configuration. What you have to do is select the project, go to the project menu Goto active configuration and selected both iPhone over the ball iPhone simulator each. It sold the problem right away. You may also notice that that we news project has this I can that it says that the load has failed. It is obvious recalls, Well, this is a Windows project. This is a Mac. A mark will not be able to access that we news project. Just like Windows wouldn't be able to access a Mac project. Now, these only happens if you have Windows project things out of your solution. I have actually made this change. This is more change within four place because a deployment target hasn't been selected. So I changed it. I selected one so this change. I should also be able to check it in. So I'm able to download those changes into visual studio if I wanted to. So I have to do is select my entire solution. I can go to version control. Andi, I can say I can choose to to review the solution and committed. So I'm going to see a list of all the changes that have been made and I can click on commit again, can set a commit change. I commit message. Um, changes were made very simple on I'm going to select boost changes to a more repository after commit in here. I am going to to be asked for allocating credential so I can set my user name on my you know, address. Click. Ok, quick push changes. The changes will start being pushed. And in here is where it is very important that I have created so alternates authentication method from team services. Because I'm here, I'm going to be able to enter the user name on the password. I think that is a password. And that is very important because seven studio, I guess they're not correct. Let me try it again. Official visual studio won't be able to connect. They're there to connect to team services with the default credentials. So I have to create the alternates credentials. So there you go. The push operation was successful, and that is how you can make changes from someone in studio to visual studio team services . 20. Version Control with VS and Github - Sync with Github: with the alternative indication credentials created, we can now talk about thes bonus video in which we are going to my grades are project from team services from shows your team services to get hope. Now these may be useful when you want to share your repository when you want to share your code with anyone to make it available to anyone who wants it. For example, you who is watching this video? Who may want down one of my projects I cannot share to you Ah, public link directly from Michelle's your team services that is Onley four people what you invite to my project in this case, the song, the song up Project boats I can migrate everything that is inside of this project to a kid cover oppo satori, which I can make public, which I can now sure to you and you can just download the coat. And it's actually quite easy. End It happened so fast. Well, I have to do is combine to to my code for myself a project click again Im clone and copy again The clone You're out and of course, rumor that you have to make sure that you have already going to your profile to security and to alternate authentication credentials. And the thing that you have to do is go to your get called. In this case, I already have a getting of account. So I'm just going to sign in and you're going to click on the new Europe Satori Bolton. Here I am going to set the name to something were similar to what I have on team services. I'm going to make this public, make sure that you do not initialize thesis with a repository their history with their with me. Sorry, and then click on Create Repository. And here you have some options from where you want the code to come from. The last option is to import it from another repository, including the foundation services, which is actually just team services. So I'm going to click on import code. I am going to haste the Coomer, the clone mural that I copy it from team services. I'm going to click on Begin import ive gift of asks for your credentials for some kind of credentials, hit Bob to your team services and expanse the G eight credentials here. Apart from the clone Eurail he will have some user name some ideas, which is an optional user name, and you have to set some password saved to get credentials and hit back. To get hope entered them and click on Submit, you will see that the import is complete. You can hit back to Europe osa torrey, and you have the code itself writing. There. You can see the solution and all of the projects, and here you can actually click home clonal or download. And you have these public, um Eurail, which you can actually share, and I could actually share with you, and you can download the project into your desktop or download as a say file. 21. Intro to C# - Hello World: Okay, Now that you have summary ready either with summering studio on micro windows or on visual studio on your Windows PC, it's time for us to learn about C. Sharp. C Sharp is going to be the language that we're going to be using throughout occurs. So I believe it's very important for you to understand the key features of the language, how the syntax works. So either you're in visual studio or in seven studio, you're going to want to go to file new and in here in visual studio you're going to create to select Project. I believe in here. We're going to select solution now in Suffering studio, make sure that you select other, and in the other section you have dot net, you hear, make sure you select council project. Also, make sure that C Sharp is selected as a language and click next, and we're going to name our project. I'm just going to name these my first c sharp up. I'm going to create it in visual studio. It's pretty similar to this. You have to select, I believe eats desktop application, and then you can find Ghoshal application so you just have to select new project Goto Windows test up this stop applications something like that. And there you can find council application and you'll have something very similar to what we're seeing right now. So the first thing that you should notice is that you have a solution, which is what we created in this case. It's just gold the way we named our application and the solution in in summary in studio ease displayed with a pink Aiken Inside of the solution, you can have multiple projects. Right now, we only have one which is called the exact same way. Might see my first You shut up on inside of the project. We have multiple things in here. We have some references in this case to certain name spaces that were going to be using. You can add some packages right now. It doesn't have any packages, so it just shows empty. You have the properties where you have some and seizure file with the assembly information , and you also have the most important thing right now. The program dot CS now see assistance horsey sharp show any file that you see with the CS extension. It means that it's teashop goat, and this file is where we're going to be working right now. So we actually, captain goes already. If you don't have any code, maybe you created it in visual studio and it's not showing anything. I don't remember, but it's quite simple with me, explained line by line, The first line we have is a using sentence. This using is just telling this file that is going to be using the system means it's quite simple, right? I'm going to be using the system name space. Next thing that we have is nothing. Then we have a name space and we're going to define name space a little bit further into these cures. But it's quite the same thing. My first she sharp up is going to be quite the same thing as system. If, for example, I have another C sharp file and I wanted to use something that is in this file. I will just have to ride using my first C sharp up now inside of the name space, I I can have multiple classes, is drugs and we'll little things. What we have right now is just one class that it's cold main class, and it happens to be the actual main class that will have the main method that will execute as soon as I wrong this application. Now the main method has to be a public static, void method, and it's going to be receiving array, off strings and inside off the method. We actually have a line of gold. It says Console great line, and these right line method receives a string argument. And what this is going to do is just write something to the council, and the council is actually going to be very careful throughout the entire occurs when we want to know exactly what's going on. If a line of code is actually executing or something, of course there are better ways to do so good. We will be using the console, that right line method out lots. Now, of course, Hill World. That's always the first thing that we should do. You say, Hey, the world. So let's do that. Now that we understand more about what is going on in this seizure files, we're going to run this and we see the console and inside of the council we actually see how the world just as you'd expect, and we have some press, any key to continue. This means that by default summering studios, helping us to just stop the program from finishing. You will expect us to great something before it continues. So if I write something, it will say a local TV station is something that someone does bought. If we actually wanted to stop the program by ourselves or we have to do is console, dog race or risky or relying, And this way the council is going to wait until the yusor write something so the council can rate it. 22. Intro to C# - Variables: Okay, so we have our hello world application we can see in the council. Hello, World strength. Let's go here before there. We already have a read line method which will wait or will execute until the user presses the enter key. And we'll, of course, be able to have whatever was written in that line. So let's go ahead and run this application and see what's going on. So we have here that it's waiting for something that Mr mean a little bit. So we have a whole world, of course, and it's waiting for something and needs of court waiting for me to write a line to. I'm going to ride hello When you click Enter and it going to continue to what we see previously. What we saw previously with president you to continue or something, right? Okay, look, how do I retrieve that? Hello string that I Grote. Well, it's quite simple. The read line method actually look at its definition. It's public static string read line. This means because it's a string, it's off string type. It's actually going to return a string. So to retrieve that string that I'm writing, all I have to do is write string. I don't know. Hello. Equals counseled old read line. So if I execute this one more time I am going to see how the world I am going to grind Hello again. And nothing happened older. Look at what we have here. It says the variable Hello. He's assigned but its values never used That should tell me something. So the variable has something. It's just that I'm no using. So how do I make sure that I actually retrieved the value? Well, I kept I can do console dog, great line. And inside of it I can ride the hello viable just to make sure that I actually retrieved something So let's run this one more time I have for the world again I grind Hello. Ah, hello Comes back because I actually retrieved it to a variable. I'm writing the value of the variable again in the council. So there you go. It's very simple to retrieve something Now what if I, instead of just saying hello world We're asking for great Two numbers we could send expecting to numbers I should do to read lines. Right? So I'm going to rename these Hello to number one. I'm going to create another number two, and it's going to do the exact same thing. Council door read line Now you may think, Well, if these are numbers, why are day strings will remember the read line? It's a method that returns a strength so I can't do something like int because read Line is returning a string. Notice how, If I try to run this where I built this, he tells me that I cannot implicitly convert string to an integer because now Number one is an integer. I can't print it to the great line method because right line on Lee has a strength argument . So I'm going to movies back to to strength. I'm going to build it. And now, of course, the Hello Variable. It's not existent, so I may preened Number one, and I'm going to do a plus. Number two Shari number to. So what I'm doing right here is writing a strength that is going to contain both the number one strength and the number two string. But keep in mind that this is not an addition. It's not going to ask one pulls, too. It's just going to mix both strings together. In fact, I may, at some spacing here for the strings do not be quite together, but separated by something. So in order for this to be a little bit more clear, I'm going to run this. I have the coastal again. I have great numbers. Okay? I'm going to write four, and it's asking for another. I'm going to quite 67 and notice how I in fire to get four space 67. 23. Intro to C# - Casting: Okay, so in our application on So now we're ready. Received two numbers. It's toward them into string variables on display them. But if I'm asking for numbers, maybe I should be doing something more with them. That Joe's displaying them. I should be, I don't know, having them, right? So how do I do? I I tried making these integers Or maybe flowed. In case the number is he? It's a float value with decimals. What if I try to build this? I get some errors because it happens that I cannot convert implicitly a string to a float. So what do I have to do then? I have to do some casting. I need to make this string that I'm re dream from recline to be able to be read a A float. So it's actually quite simple to do that. What we have to do is great float, and the float type has a parts method that will parse whatever string I passed to it, and it's going to convert it to a float. So knowing that I can do the same thing with second number, so float and in here I'm going to write, float. If I write it correctly, float pars and going to pause that string that I'm reading from the council. Now that I have the numbers, I should be able to actually aunt them. And because these are numbers, all I need these two off them the way we I would think with a plus value. But let me try and build this and see you feed actually can b round and it appears everything is correct. So let's go ahead and do that. And it's going to asked me for two numbers that's always going to grind five. And I'm going to write three. And now I don't get five space tree. I actually get the evasion of both numbers, which is you guessed it. Eight. So there you have it. It's it's It's very simple. What I'm doing here is just converting that string I'm receiving from the read line method to a flowed. So I can actually off those numbers together now because these are float numbers. I could actually dried something other than just integers. I could be doing something like four or three dog 14 and to doled 71 and I can actually do that on at then together because floats can't have decimals 24. Intro to C# - Methods: Okay, So we now created an application of an application that can ask two numbers together but do the same thing but a little different. Let's create a method. I'm going to create a method which is going to be of type float. This is hard to find its type, and it's going to be cold off to numbers, right? And you want to have some body, of course, and the method it's going to be needing those two numbers that is going to be adding, it's going to be needing to arguments on both arguments are going to be of type float, so to do, to define these arguments and going to quite it's type. I'm going to write some name for such arguments. For example, number one or anyone and another float and into and all this is going to do ease off these numbers up. So the addition or the result I'm going to create a new float result, and the result is going to be pulled to any one applause and to that simple at the end of this addition, I of course, need to return the value, so I'm going to return it by just grating return result just like that. So why did I do this? Well, instead of just grow writing in here the Greenland method. What? I want to go right? What I'm going to do is just call this method. And of course, this method requires both arguments. So the first argument is going to be number one. The 2nd 1 is going to be number two just like that. Another thing that you need to keep in mind is because we're on a study method. All we can do is call static methods. So it doesn't just need to be a float method. It has to be a static method for me to be able to call it from the grind line methods. But Okay, right, I great method. Then they moved. Method I passes its arguments. The method is going to receive the arguments off them up and return the result. And since I gave it the resource return diary, salt is received by the great line method and it's going to do it stink, write it up in the council. So let's prove that this is actually working. I'm going to run my application. I'm going to great two numbers and it's adding them. It's working the exciting way as the previous one, but we're now you seeing a message. 25. Intro to C# - If Statement: Okay, so right now we're string to numbers and audio through a method that we already created. But what happens if the user wants to do something else and adding them? What happens if he wants to substructure them or multiply them? Well, what we're going to do now requires some evaluations. It's not just about doing whatever we want with those numbers. It's about letting the user decide. So the first thing that we're going to be doing is writing some options for the user. Sue going to go right? Um, select an option. What I can do here He's do a jump these slash and indicates that I'm going to do a return. So after these, I can actually dried one us and I can write that again. It's a return and ride to sister Act Three Men multiply and for divide right. And after this, I'm going to expect the user to great something. So I need to read on when I read. I need to get the number in this case, I'm going to receive anything. Here is just 123 or four, and this is going to be option, and this is going to be equal to end dog pars is just like the float and console. I keep writing you're wrong, read light like this, and just to make sure that I'm receiving the correct option, I'm going to do console, Munsil told Great Line. And I'm going to write option just to check that everything is working. Okay, Until that show, I'm going to run this. It's going to ask for dose to numbers. I'm going to give it to them and it's going to ask for an option. I'm going to select it. It says that in fact, I'm receiving the correct option, which is one so all good until now. Okay, so I have the correct option. I don't need this in here. I have the option which is going to be either want to tree or four. You hear? I want to do some evaluation and what I'm going to do sexually great a method to do the evaluation for me, so I'm going to create a public static. There's going to be a voice method because it's not going to return anything. I'm going to call it, evaluate, option. What is going to receive? It's just an integer which is going to be the option, and here I am going to do the evaluation. But of course, I need to call that evaluate option method. So evaluate option which is going to be receiving the option, which is an into here, and that's it. My evaluate option method is already receiving that option. Now you here is where the phone is going to start. I have the integer. What I want to know is, even in theory, the indigent is one, 23 or four. The easiest way to do it is to evaluate if option is equal equal to one. If it is equal to one, I'm going to do something here and what I want to do. East actually council. Actually, I can just copy this because I want to go to the console. The addition off the numbers and I can actually delete this from here, right? If option one. If the option is equal to one, it means we're going to be adding the numbers. We just great line and inside of the grind line. We call the author matter, which is after two numbers. Let's test if everything is working correctly right now, so notice God, we have a big error in here now. It says number one just not exist in the current context. And in fact, number two does not exist in the current context either. What is this? Well, number one and number two exist only in the main methods. This context is between these curly braces. So whatever is inside of these currently braces works inside of the curly braces. And since I define these numbers inside of this curly braces, these numbers are only existent inside off those curly braces. So how do I do this thing? How How do I pass those numbers do this method? Well, it's quite simple of we've done it before. All I have to do now is I don't only need the option. I'm also going to be needing the number one and number two, right, just like we did in the two numbers. And instead of doing number one and number two, I'll just do and one and to. But since now my method is asking for tree arguments. When I called mated, I have to pass those two other arguments. The 1st 1 is going to be number one. The 2nd 1 is going to be number two like this. Now, I should be able to run it. Oops. I did something weird in here. It's not compared to its comma coma. Okay, And now I should be able to run it. There we go. And we have great numbers. Whatever numbers you want, right, select an option. We're going to select one, which should be the only one that's working until now. Andi, I believe it's starting them. Yeah, it's starting them. That's the result. Exciting them. It's working the way it's supposed to. We're doing great. Now I'm just going to ask a little thing to my coding here just to make this a little bit more useful for the use. Or I'm going to write here, resold off the addition Colon And that the dean. What the hell did I grow there? Three shin like this. And now when I got something, the user should know that it was an addition that was performed. So I'm going to dry those two numbers. I'm going to ask result of the issue in 597. Perfect 26. Intro to C# - If Else Statement: let's continue building our application. Until now, we're only evaluating when the options one and if the option is one. We asked the numbers, calling the asked to numbers message. But what happens if the action is two or tree or for So in this case, if option is not one, we're going to be needing an else statement as is. We are also evaluating Ive. The answer is to we're going to be needing an else ive statement. These will also require an option evaluation in this case, if it is equal to to. I hated something justice I love. It wouldn't like this anyway. If option is equal to two, I'm going to be needing something else. I'm going to be getting something similar today, so I'm going to copy it. Result of this obstruction bought. I am going to need another method, which I'm going to call just It's obstructing numbers in felt I can copy. These are two numbers methods, rename it and change the operation that is happening here. It's that simple. And now I'm going to copy the name of this method. I'm based in here and scenes. What I wouldn't do is evaluate this another time. I'm just going to go up it. Evaluate if it's equal to tree change this to multi publication. I'm going to be needing another method. I'm going to copy and paste it and change its name to multiply. Kate, multiply two numbers. And of course, I need to change. The operator in here noticed that the multiplier is ah, star, copy the name off the method. And finally, I'm going to be requiring another evaluation, which is going to be easy. Option is equal to four language gays. I'm going to divide division. Okay, so I'm going to corporate Ismet it one last time, change its number to divide two numbers groups and change the operator to its corresponding one GOP The name of the method based on a here, So that should be enough. But what happens to the user presses Five or something I'm going to do on else in here and then this is not going to be having hated whatever. It's not going to have any other evaluation. It is going to be else if option is not one nor two, nor Cherie, nor for I'm going to do whatever is inside here I'm going to do a consul adult right line and I'm going to and bright involved. Option. That's it. So let's go ahead and run this and check if everything works correctly. So I have Okay. Two numbers. I'm going to grow the 1st 1 and the 2nd 1 just like the past times you can. I'm going to select an option. Let me just select the second option. We salute off this obstruction, and that appears to be the option. Their very soul. That's well, So there you have it. We're already constructing, adding, and I would guess that the multiply and the divide functions work as well. So, in fact, let's just let's just try this involved option thing where we write something that it's not supposed to be growth. So something that is not yeah, ball it. Let's select the option number 3300 and 23 he just says in my adoption. So since the option is not one, it's not, too. It's not a tree, and it's not four. It's just something different. You will just tell May. It's an important option. One last thing before we move on. What happens if I want to do a different evaluation with different numbers. Different options. Well, what I'm going to do is move this all of this code to another method. So I'm going to cut it. I'm going to create another method. The league static void start. It's not going to receive anything, but it is going to be executing the exact same thing. I'm going to call it from the main meant it. Okay, so the main method is called the start. May, that is called I great your numbers, I select the option and now you evaluate the option. Once the evaluation is completed, I should start again so I could start one more time and I should be able to write numbers, select an option on so on and so forth. What? I'm going to be needing a final option in here, which I'm going to be calling for life on. It's going to be exit. Okay. And since I already have another option, I'm going to be needing and else if staying many here and I need to evaluate if option east equal to five. If that is the case in here, I'm going to be needing to close the application and close the application. All I have to do is return now. Why Return Return is going to say that these evaluates option Method East completed. So once I hit return it is completed and complete it in the start methods. So when evaluate option, it's complete. It moves to the second line to the following line, which is the aunt off the start method. Since it's the end of the start, mattered eat. Just It's the end of the start method, and it goes to the full winglike, which is the end of the main method. And that's it. On the other hand, if I didn't have return, if it's any of the other options, it's going to keep running until it hits the start methods. I'm just going to call the start method, and it's going to ask f