Creating a Universal Windows Platform (UWP) App in Visual Studio

 Gallo-crop-3

With the release of Windows 10, Microsoft has introduced a one platform fits all devices model. This platform is called Universal Windows Platform (UWP) which means all the apps which are created on UWP platform will run on all the devices running Windows 10. With this evolution, apps that target the UWP can call not only the WinRT (Windows RunTime) APIs that are common to all devices, but also APIs (including Win32 and .NET APIs) that are specific to the device family the app is running on. The UWP provides a guaranteed core API layer across devices. This means you can create a single app package that can be installed onto a wide range of devices. And, with that single app package, the Windows Store provides a unified distribution channel to reach all the device types your app can run on.

What a wonderful and time-efficient approach it is for developers where they had to target each device in the past but now they will have to work on a single package to cover all the devices. Amazing!

This blog gives you a step-by-step information about how to create UWP app in Visual Studio. In order to create a UWP app, you will need the following tools.

1. Windows 10 (Recommended) – however, Windows 8.1 may also create UWP apps

2. Visual Studio 2015 Community Edition (It is a free software available online)

Following are the steps which are needed to be performed (Please remember that I am using the black theme of the Visual Studio and chances are you might have the same thing appear in Blue theme or white theme so please consider that in mind while going through these steps):

1. Start Visual Studio and click on NEW Project option. You will find this option right in front of you once the Visual Studio is executed. If you don’t find that option then click on File option on top and then New and then Project as shown in the following image:

new-project

2. This will pop up a new window which will ask you to select the Project template and the name of it. Following is the window which will appear:

new-project-name

3. Our next step is to choose the right template which we want to use. In our case, we want to use the blank template for our Universal Application. On the left side, choose Templates -> Other Languages -> Visual C# -> Windows -> Universal.

UWP-template-selection

4. Once selected, on the right side, it will display the list of templates available for Universal app. Following is what you will see:

UWP-template-selection2

We will choose the first option here and select Blank App (Universal Windows).

5. Type the name of the project which you want to keep, set the location of the project and then press OK

UWP-template-saving

It will automatically create a new BLANK Visual Studio solution and all the necessary files with settings required.

You will see two sections of the screen, one will display the editor with the app.xaml.cs file opened as shown below. This is the region where you may edit the code and save it after making changes.

solution-app-xaml

The other region is on the right side which will display all the projects setup for you along with the files within each project. In the following image, it displays the list of files within the project created.

UWP-project-files

If a device is selected in the top navigation bar and the project is compiled at this moment, it will display a successfully created blank page. You may now start working on this page by adding different contents.

Hope this makes it easy for you! Enjoy coding UWP apps!