Welcome to our first #XamarinAlliance coding challenge. Through a series of coding challenges you’ll learn how to develop cross-platform mobile apps using Xamarin and also how you can integrate Azure services to make your apps connected. You can expect to see a new coding challenge become available every two weeks.
The goal of this first coding challenge is to set up your development environment for Xamarin development and have a Xamarin up-and-running on your machine. This will be the basis for the next coding challenges, where you’ll further expand the functionality of the app.
For those of you who have never used Xamarin or have no idea what app to build, we want to give you a head start by providing you a basic Xamarin Alliance template app. If, on the other hand, you already have experience in building Xamarin apps or you have a great idea in mind for an app, you can also complete the coding challenges by building your own app.
Regardless of whether you use the template app or build your own, make sure to add some creativity to your coding challenges! Feel free to tweak the user interface and design, use other data sources or add more functionality to make your app really stand out. Throughout the coding challenges, we’ll give you some ideas on how you could further improve the app.
With Xamarin you can build cross-platform mobile apps and you can do so on Windows or Mac, with Visual Studio or Visual Studio for Mac respectively. For doing the coding challenges, we leave it up to you to decide which platform you want to develop on.
As mentioned, the goal of this coding challenge is to set up your development environment for Xamarin cross-platform development. To complete this coding challenge, you need to achieve the following steps:
- Set up and install the development tools
- Get/Develop an app
- Get a Xamarin app running on your developer machine
1. Setup and install the tools
You can get started for free with Xamarin, as it is free in all editions of Visual Studio 2015. With the Visual Studio 2015 Community Edition, you have all the tools you need for free.
Depending on your preferences of OS and Visual Studio version, following one of the following guides to get your machine up-and-running for Xamarin development. These guides will ensure you have the developer tools as well as required mobile emulators on your machine.
- If you’re using Visual Studio 2015 or install on a Mac, follow the guide for getting set up with Xamarin.
- If you want to use Visual Studio 2017 RC, follow these instructions.
- If you want to use Visual Studio for Mac Preview, follow these instructions.
- If the installation fails, you can perform a manual install.
WARNING: Xamarin is compatible with Visual Studio 2017 RC, however Xamarin cannot be used in earlier versions of Visual Studio on the same computer.
2. Get/Develop an app
I want to use the Xamarin Alliance template app
- Download the source code from this GitHub repository.
a) Navigate to the Xamarin Alliance GitHub repo
b) Click the green ‘Clone or download’ button and either download the zip file or clone the repo using Git.
- Unblock zip file (ignore this step if you’ve cloned the repo) : Right-click the zip file in Windows Explorer and check the ‘Unblock’ checkbox and press ‘OK’
- Extract the zip file onto your local disk (ignore this step if you’ve cloned the repo).
- Open the solution in your IDE.
- Optionally, modify the app template code to make it your own app. You can find out all the basics about building Xamarin Forms based apps here.
TIP: If in Visual Studio the Android and/or iOS project doesn’t load and shows up as ‘(unavailable)’, right-click the project and select Reload project.
I’m building my own app
- Open up your IDE (Visual Studio or Xamarin Studio) and begin to write your app.
3. Get/Develop an app
In this step you’ll run the app on your development machine. Depending on which platforms you want to support, you’ll run the app for one or more platforms.
- To run the app for a given platform, you right-click the corresponding project, and select Set as startup project
- Now select the appropriate emulator (or physical device) to run the app on and press F5.
For a detailed description, check the following guide for verifying your installation.
TIP: If you encounter the “Cannot connect to the debugger” when running on the VS Emulator for Android, follow the steps outlined here.