by Santhakumar Munuswamy
Posted on 19 June 2016
UWP
In this article, we will discuss how we can understand the Universal Windows platform, Prerequisites. setting up the environment, and so on. When I was starting to learn UWP apps, i didn't have Windows 10 OS, but now i have bought Windows 10 licensed software from the Microsoft store. Now, we will see the steps for designing , developing, building and testing the Universal Windows Platform Apps in Windows 10. We are able to run the UWP Apps with different devices including Desktop, Phone, Xbox and IoT.
Background
Universal Windows Platform (UWP) is a platformhomogeneous application architecture created by Microsoft and first
introduced in Windows 10. The purpose of this software platform is to help develop Metro style apps that run on
both windows 10 and windows 10 mobile without the need to be rewritten for each. It supports windows application
development using C++, C#, VB.Net, or XAML. The API is implemented in C++ and supported in C++, VB.Net, C#,
F# and Java script. Designed as an extension to the windows runtime platform first introduced in Windows Server
2012 and Windows 8, the UWP allows developers to create applications that will potentially run on multiple type of
devices. (source: wikipedia)
We can easily develop UWP apps with help of API package and run them on all window 10 devices including Phone, desktop, tablet and so on. It also supports a number of screen resolutions.
Image source: msdn
Prerequisites
You have to download the following software and install then on your PC.
- Windows 10
- Visual Studio 2015
- Windows 10 SDK
- Windows Phone Emulator 10
You can download and install the free community edition of Visual Studio 2015 from Microsoft Developer portals.
Setting up the environment
If you want to know how to install the Window 10 SDK and Windows Emulator, 10 step-by-step guide available on,
We have discussed window 10 SDK features in the my previous article.
How to develop, build and run UWP App
We are going to discuss how to develop, build and run the UWP Hello World App and show the demo
in multiple devices. We will see the step by step guidelines for the UWP Hello World App creation here
Step 1:
Open Visual Studio 2015. Go to file menu, point to new and then click new project. New Project window
will open, you can select a installed template like “ Universal” under the Windows on Visual C# Template,
and then select a Blank App Universal Windows) and type Project Name UWPHelloWorld. Choose the
project location path and then click on the OK button.
Now, you can see the UWPHelloWorld project structure as in the following screen shot.
Step 2:
Package.appxmanifest: This file contains your app name, description, language, start up page and so on.
Asset folder: This folder contains a collection of images like logo, windows store logo, splash screen as follows:
ü LockScreenLogo.scale-200.png
ü SplashScreen.scale-200.png
ü StoreLogo.png
ü Square150x150Logo.scale-200.png
ü Square44x44Logo.scale-200.png
App.xaml and App.xaml.cs: This file contains a constructor that calls the InitializedComponent method
and it an auto generated code by Visual Studio. It is mainly used to initialize the declared elements in
the xaml file. It also contains the methods to handle the activation and suspension of the app
MainPage.xaml and MainPage.xaml.cs: This file contains a user interface (UI) code. The code at back end is the logic code and event handler code for your app.
Step 3:
MainPage.xaml
<Page
x:Class="UWPHelloWorld.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWPHelloWorld"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Padding="50 50 50 50">
<TextBlock Name="txtMessage" Text="Hello World" FontFamily="Tahoma"></TextBlock>
</StackPanel>
</Grid>
</Page>
Step 4:
Now, you can run the UWPHelloWorld Apps with different devices, you can see how a apps looks, as
shown below:
Select a Debug and Mobile Emulator 10.0.10586.0 WVGA4 inch 512 MB option to run the apps
Select a Debug and Local Machine option to run the apps
Conclusion
I hope you understood the UWP and how to develop, build and run on multiple devices. I have
covered all the required things. If you find anything that I missed in this article, please let me know.
Please share your valuable feedback or suggestions.