Xamarin with Visual Studio 2017 - Build native cross-platform apps
Along with the launch of Visual Studio 2017, Microsoft has released many fresh and exciting features for mobile developers to develop cross-platform mobile apps using Xamarin. Visual Studio 2017 will help you to build better native cross-platform apps in less time as compared to Visual Studio 2015.
In this article, you will learn about how to setup Visual Studio 2017 for xamarin development and what are the new features Visual Studio 2017 supports for mobile apps development using C# and Xamarin.
Install the Visual Studio 2017 IDE
To get started with Xamarin apps development, download Visual Studio 2017 and install it on your windows machine. The VS 2017 is compatible with Windows7 SP1, 8, 8.1 and Windows 10. You can download it at Visual Studio 2017. I have installed it on Windows 10.
Setting up Xamarin
Visual Studio 2017 is a lightweight IDE than ever! The new Visual Studio installer enables you to choose components which you want to install. This strategy keep the Visual Studio installation smaller than ever before and it installs the updates faster too.
Setting up Visual Studio 2017 for Windows Universal Platform Development
If you want to develop UWP apps using Xamarin then you have to install Universal Windows app components as well as shown in following fig.
Setting up Visual Studio Emulators for Android and Windows 10
Visual Studio includes an Android emulator and Windows 10 Emulator that can be used to test and debug an Xamarin.Android and Xamarin Forms apps. The Android emulator uses the Hyper-V capabilities of development machine which results in faster launch and execution times than the default android emulator that comes with the Android SDK. To install both the emulators just navigate to individual components option and check the options in the following fig.
To run the visual studio emulators, your machine must meet the requirements to run Hyper-V. Hyper-V requires a 64-bit version of the Pro edition of Windows 8, Windows 8.1, Windows 10, or higher.
Verify your Xamarin Installation
Once installation is complete, you should verify your Xamarin development environment.
Visual Studio 2017 Xamarin.Forms Preview supports
With Visual Studio 2017 and latest release of Visual Studio for Mac, Xamarin.Forms XAML page you can preview in Xamarin.Forms Previewer to see expected layouts and design in Android and iOS device. make sure you have installed the latest Java 1.8 x64 for Android previewing. To open Xamarin.Forms Preview follow the following steps as shown in given fig.
Improved Xamarin.Forms XAML IntelliSense
With Visual Studio 2017, any Xamarin.Forms XAML page now supports improved IntelliSense experience for code completion, bindings, custom properties, custom controls, converters, and much more.
Creating Xamarin Forms App with Visual Studio 2017
In Visual Studio, create a new Blank App (Xamarin.Forms Portable) solution and name it XamarinFormsApp. You can find this template easily under Visual C# option for Cross-Platform.
After clicking OK to create the solution, you’ll get two templates for creating app. Choose Blank app template with with UI technology Xamarin.Forms and Code Sharing Strategy Portable Class Libary (PCL).
It will create a Xamarin Forms application with four projects targeting Android, iOS and Windows UWO app. Within each native project you have access to the native designer for the corresponding platform and can implement platform specific screens and functionality as needed.
Now build the application and run it for Android device. You will get the following output in your Visual Studio Android Emulator.
Congrats, you have successfully build your first native cross platform mobile apps for Android, iOS and Windows UWP.
What do you think?
Thank you for your time, I hope you enjoyed this article and found it useful. Please add your comments and questions below. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.
Take our free skill tests to evaluate your skill!
In less than 5 minutes, with our skill test, you can identify your knowledge gaps and strengths.