Creating a Xamarin Project

Now that you’ve got Xamarin installed, I want you to go ahead and open up Xamarin Studio. Note that you can follow this tutorial using Visual Studio using the Xamarin Plug-ins for that, and the workflow is pretty much the same. So, if you want to go that way that’s absolutely fine, but we’re gonna use Xamarin Studio. Once you’ve opened it, you are effectively in a lite version of Xamarin Studio, and what we need to do for this course to is to create ourselves a Xamarin account. So, if you click this log in button in the top corner it will ask you for your account details. We don’t have those at the moment. So come down here and click create account, and once you do that it will take you to this page on Xamarin’s website. You just put in your name, email, password, and you have the option here, to start a 30-day Xamarin trial. Now, this gives you access to the business version of Xamarin, which is what we want. Once you have finished this course the business version is the one that you should have if you want to use Visual Studio. You can get by on the Xamarin Indie Edition, which is much much cheaper, I think it’s a quarter of the price of the business version per year. This indie edition is perfectly fine for personal projects. So, once you’ve done all that click accept, and then come back here and enter your details. Once you’ve done that and you’ve clicked logged in, it will tell you: “You are now subscribed to Xamarin business.” I can subscribe on four computers, but on a trial I think you can only subscribe on two computers. So go ahead and close that. Let’s get started with creating our very first solution. So, come over here and click new solution. Now, if we look through the various options we have here, we have cross platform iOS, Android, Mac and other. If you’re only going to create an app for a single platform i.e., iOS or Android that’s fine, you can choose one of these options. I would advise to always choose cross platform because if you so decide you can add another platform later, and it’s going to be a lot easier than trying get all of your files together. So, we will click app and now you have a choice on cross platform, we can either do forms or native. Personally, I’ve used Xamarin forms and if you look over here in descriptions, it doesn’t actually say anymore, but it used to. Xamarin forms lets you write ones and run everywhere even on the graphical user interface which can be a good thing, but it can also be a bad thing because you can’t use the full system resources and various user-designed processes on Android or iOS if you use a generic version. But, if you choose a single view app, it allows you to use the entire Graphical User Interface native to each platform. So you can use everything that iOS can do and you can use everything that Android can do, and forms doesn’t let you do that. So, I would always choose single view app. Click next. It’s going to ask you for an app name and this could be anything you like. So, we’re just gonna call this note taker, and you’ll notice down here it doesn’t identify it for you. Now, this indentifier is going to be used to identify your app within the phone ecosystem on both Apple and Android. It’s typically formed of three words each separated by a period, and the first one is always com, the next one is your company name, but in this case I just put my name .grant.note_taker, and this is a unique identifier for your app. Right, so if you go to your Android developer account or your Apple developer account this identifier must be free. You’ve got to make sure that it’s free. Then we come down to shared code. We can either use what’s called a portable class library or a shared library, and the only difference between these two is how easy it is to share your code with other developers. If you want to share your code, and package it in one file, and to send it to loads of people you use a portable class library. If you want your code to allow you to do a lot more things then we use a shared library, and generally, I would say, let’s use a shared library and you can’t share your code as easily with people, but it allows you to do a lot more. We’re gonna take advantage of that so we can write a shared database later for both of our apps. So, go ahead and click next. It will ask you for a project name and a solution name. I would ignore this for now, just leave it as the default and I will explain what that means a bit later on. Lastly, you want to save it. So, wherever you want to save it it’s fine. You can save your projects in Dropbox. It syncs absolutely fine, no problems. So we’re gonna hit create and once it has worked through what it needs to do you come over here, and you’ll notice you have a bunch of essential folders, a tree structure. So, we’re going along like this. In the next lecture I’m going to explain exactly what each level of that tree structure is and how we’re going to structure all of our apps relative to these trees that you see here. So, join me for the next lecture.

Leave a Reply

Your email address will not be published. Required fields are marked *