Universal Windows Platform (UWP) is a Metro Style application architecture started in the Windows 10 operating system by Microsoft. The UWP type of app can run on different devices running on Windows 10 OS, like Desktop, Phone, HoloLens, Surface etc.
Image Source - Microsoft
A device family is the foundation of an Operating System. PCs run the desktop Operating System which is based on the desktop device family. Phones and tablets, etc., run the mobile Operating System which is based on the mobile device family. And so on.
Image Source - Microsoft
Benefits of UWP
For anyone who develops their own applications in-house, this will radically reduce the time needed to create apps that run on desktops, tablets, and mobiles, thereby shortening their time-to-value on their investment in development. ie., it reduces the cost.
This article mainly focuses on how to create UWP app in Visual Studio 2015. The following important tools are required for developing a UWP app.
- Windows 10 (Recommended).
- Visual Studio 2015 Community Edition (It is a free software available online).
Now, we can discuss step by step App Development.
Step1: Open Visual studio 2015 -> Start -> New Project-> Select Universal (under Visual C#->Windows)-> Blank App -> Give the suitable name for your app (e.g., MyFirstApp) ->OK.
Note: Here, we can see in the image that Universal App supports all devices from Microsoft (PC, Mobile ,XBOX, etc).
Step 2 : Choose the Target and Minimum Platform Versions that your Windows Universal Application will support.
Step 3: Now, create the project “MyFirstApp”.
Step 4: After the project is created, it displays the App.xaml.cs.
Note: App.xaml is the declarative starting point of your application. Visual Studio will automatically create it for you when you start a new UWP application, including a Code-behind file called App.xaml.cs.
Step 5: For debugging your “MyFirstApp”, select your device.
Note: Here, the options are,
- Simulator - deploy the application to a simulated environment on your current development machine.
- Local Machine - deploy the application to your current development machine.
- Remote Machine - we specify a remote target to deploy the application (remote IP address for your device like machine, XBOX,one, IoT Device etc) .
- Device - deploy the application to a USB connected device. (Windows Phone)
- Mobile Emulator - target will boot up and deploy the application to an emulator with the configuration specified in the name. Emulators are only available on Hyper-V enabled machines.
Step 6: If the deployment source of your app is a Local Machine, default splash screen appears first.
Step 7: The output of the default UWP app on the Local Machine is:
Step 8: If you want to stopthe debugging of your app, just click the stop button.
Summary: Now, you have successfully created and tested your UWP app.