UWP Development, Developer Mode Settings

Windows UWP (Universal Windows Platform) is a platform for developing apps that can run on various Windows devices. UWP apps have the advantage of being able to operate on multiple forms of devices such as desktops, tablets, Xbox, and IoT devices.

Need for UWP Development

UWP is fundamentally designed to allow the writing of applications that run on Windows 10 and later versions of the OS. This enables developers to provide the same user experience across various devices with a single codebase. Furthermore, Microsoft continuously supports UWP to offer innovative experiences in terms of security, performance, and UI/UX.

What is Developer Mode?

Developer Mode is a feature that allows developers to easily test and debug applications on the Windows OS. When Developer Mode is activated, developers can install and run their UWP apps under development and access additional debugging tools. UWP developers must enable Developer Mode to develop and run apps.

How to Set Up Developer Mode

  1. Open Settings

    First, click the Windows start button and then click ‘Settings’. When the settings page opens, select ‘Update & Security’.

  2. Select Developer Options

    In the ‘Update & Security’ page, select the ‘Developer Mode’ tab. Here, there is an option to enable Developer Mode.

  3. Activate Developer Mode

    Select ‘Developer Mode’ and activate it. At this step, you will need to click ‘Yes’ to accept the confirmation message.

  4. Check Required Install Components

    Once Developer Mode is activated, you can additionally install and set up Visual Studio or other development tools. To develop UWP in Visual Studio, you need to install the ‘Universal Windows Platform development’ workload.

Installing Visual Studio

It is recommended to use Microsoft’s Visual Studio IDE for UWP app development. The installation process for Visual Studio is as follows:

  1. Download Visual Studio

    First, download the installer from the official Visual Studio website.

  2. Run the Installer

    Once the download is complete, run the installer and choose the ‘Universal Windows Platform development’ workload from the various installation options.

  3. Check UWP Templates After Installation Completion

    After the installation completes, run Visual Studio, select ‘File’ from the menu, then choose ‘New’ and ‘Project’. Here you can check for the UWP application template.

Create Your First UWP Application

Now that Developer Mode is activated and Visual Studio is installed, let’s create your first UWP application.

  1. Create a Project

    Select ‘File’ > ‘New’ > ‘Project’ in Visual Studio. Enter ‘Blank App (Universal Windows)’ in the search box, select it, and then click the ‘Create’ button.

  2. Configure Project Settings

    Set the project name and storage path, and configure the minimum and target platform versions. Usually, using the recommended settings is acceptable.

  3. UI Design using XAML

    Once the project is created, the MainPage.xaml file opens. Here, you can design the UI using XAML.

                    
                    <Page
                        x:Class="YourAppName.MainPage"
                        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:local="using:YourAppName"
                        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                        mc:Ignorable="d">
    
                        <Grid>
                            <TextBlock Text="Hello, UWP World!" 
                                       HorizontalAlignment="Center" 
                                       VerticalAlignment="Center" 
                                       FontSize="36"/>
                        </Grid>
                    </Page>
                    
                
  4. Run the App

    After completing the code writing, press F5 to run the app in debugging mode. The app will run on the selected device, and you will see the message “Hello, UWP World!” appear at the center of the screen.

Useful Features of Developer Mode

Using Developer Mode allows you to access several useful features as follows:

  • Debugging: You can monitor app performance and fix errors during development.
  • Install apps on local and remote devices: You can install your UWP app on your local developer PC or remote device for debugging.
  • Collect app usage metrics: You can collect metrics to improve user experience before deploying your app.
  • File system access: You can access the local file system to see how your app interacts with local data.

Important Notes Regarding Developer Mode

Enabling Developer Mode may slightly lower the security level, so caution is advised. There is a risk of installing malicious apps during the testing of the app under development, so it is best to only run code from trusted sources.

Conclusion

The process of setting Developer Mode for UWP development is straightforward, but the growth from this process is tremendous. Through this tutorial, you have learned how to set up Developer Mode and create your first UWP application. Based on this fundamental knowledge, I hope you can develop various UWP projects.

References