Hardware and software setup

Your app for Windows Phone? Easily! How to create your first Windows Phone app. Example of development on the designer of Microsoft App Studio How to create an application for windows 10

There is an opinion that in real life smartphones with Microsoft OS are as common as people with the patronymic "Artyomovich". The strange (to put it mildly) policy of the "Evil Corporation" regarding the seventh and eighth families of the mobile operating system turned away many users from experimenting with "windows" for smartphones, and now the corporation has seriously taken up correcting its image in this user niche. As an underground fan of Microsoft, I hope that they will succeed - the "ten" is walking around the planet, its main trump card is one core for all platforms, and therefore it has every chance to pull over a good part of the mobile market. And as a programmer, I will be happy to make an introductory article for you on developing for this mobile axis, so that you are always ready for the growth of its popularity :).

Architecture overview

With a common core and runtime for UWP apps, an app once written will run on all devices running Windows 10. This range includes:

  • desktop computers;
  • server systems - OS Windows Server 2016;
  • laptops - MS Surface Book;
  • tablets - MS Surface Pro;
  • smartphones - Lumia;
  • game consoles - Xbox One;
  • augmented reality glasses - MS HoloLens;
  • wall tablets - MS Surface Hub;
  • smart watch - MS Band 2.

The list is impressive. In addition, UWP is not limited only to the execution of application programs, it also supports the operation of drivers at the kernel level. This allows you to create drivers that function on various devices, provided that the specific component for which it is intended given driver, the same.

UWP supports both kernel-level and user-level drivers. The subsystem includes the Device Driver Interface (DDI) interfaces that the UWP driver can use.

But all this does not save the developer from adjusting the interface to certain platforms and screen resolutions. In some special cases, this may not be necessary.

Developer Tools

To write, debug, deploy, and test apps for Windows 10 Mobile, you'll need Visual Studio 2015 (no doubt). The third update came out this summer. I strongly recommend! Its main bugfix is ​​the reduced memory consumption compared to the second update.

Also you will need Windows 10 Anniversary Update SDK: it includes everything necessary tools to develop applications for the entire fleet of devices running on Windows 10. If you are using VS 2015 with the third update, then it already includes the latest SDK.

One of the main innovations is Windows Ink. Using this API, you can add pen support in two lines of code. There are two control objects for this: InkCanvas and InkToolbar.

The new Cortana API simplifies the implementation of voice control. The Cortana Actions component in the new API allows you to create new phrases/expressions.

Biometric windows authentication Hello is now available to web developers in the Edge browser.

The Blend for Visual Studio 2015 user interface modeling tool provides more advanced interface building capabilities than VS. With it, you can create layouts in XAML for all supported applications: application, web, universal, mobile, and so on. It also contains constructors for additional tasks, such as creating animations and controlling the behavior of elements.

Ways to create apps for Windows 10 Mobile

The main way to create applications for Windows 10 Mobile smartphones is to develop universal (UWP) apps(scroll Visual C# → Windows → Universal project creation wizards).

However, he is not the only one. As you know, Xamarin is built into Visual Studio 2015, it can also be used to create applications for Windows 10 Mobile, both for Android and iOS, changing the interface and leaving the program logic in C# (Visual C# → Cross-Platform).

In addition to the Visual C# language, it can equally be selected Visual Basic or Visual C++. VS 2015 allows you to create universal apps with JavaScript(JavaScript → Windows → Universal Applications). They can also be deployed to a Windows 10 Mobile device.

Tools for working with legacy projects

For a long history of operating Windows systems a huge number of different applications have been created for it. With the release of Windows 8 and WinRT (and later Windows 10 and UWP), old desktop applications are a thing of the past, as only Win 8 and Win 10 desktop applications support classic Win32, COM, .NET applications. This made Microsoft sad. But the guys realized that they could develop a converter that would convert old applications for the new advanced UWP subsystem. Born from this Desktop App Converter.

Converting an Xcode project is a two-step process. First you need to add Objective-C syntax highlighting to Visual Studio: install the objc-syntax-highlighting.vsix extension from the winobjc\bin folder. Then using the utility command line vsimporter.exe needs to convert an Xcode project to a VS project. After that, the resulting sln file can be opened in the studio, where the Objective-C syntax will be highlighted. You can build and run the application and it will run just like any other Windows program.

Break me down, how amazing it is to see correctly highlighted Objective-C code in Visual Studio!

A free compiler is used to compile Obj-C code Clang. Since the output is a standard UWP app, it can be run on a mobile device in Windows environment 10 Mobile. One program can have both C++ and Obj-C code.

If you have a project for a previous version Windows phone, that is, 8.1 (or 8.0), then when you open it in VS 2015, the studio will automatically update the project so that it meets the requirements of the universal Windows applications(UWP). Not only markup will be converted user interface in XAML, but also program logic in JS/C++/C#/VB. If there were calls to the WinRT subsystem in the code, then they will be converted to UWP calls.

There is another common type of application - games. iOS and Android render through the low-level OpenGL interface. On the other hand, on Windows 10 Mobile, DirectX 11 is used to display images in games. This results in incompatibility. But there is a solution - the open project ANGLE . ANGLE (Almost Native Graphics Layer Engine) - almost native graphics layer engine - allows Windows users run OpenGL ES applications seamlessly on DirectX 11 hardware. This is achieved by converting calls from the OpenGL ES API to the DirectX 11 API. ANGLE fully supports the following three types of applications:

  • universal applications for Windows 10 (Universal Windows apps);
  • applications for Windows 8.1 and Windows Phone 8.1;
  • classic apps for desktop Windows desktop(Windows desktop applications).

The issue is discussed in more detail in my book “ The magic of the moment of rotation"(Again you are promoting your book! Well, okay, you deserve it. - Approx. ed.).

Continued available to members only

Option 1. Join the "site" community to read all the materials on the site

Membership in the community during the specified period will give you access to ALL Hacker materials, increase your personal cumulative discount and allow you to accumulate a professional Xakep Score rating!

Last update: 31.10.2015

Let's start Visual Studio Express 2013 for Windows. Select File->New Project... from the menu. The project creation window will open in front of us:

On the left side of the window, select Visual C#->Store Apps->Windows Phone Apps. And among the templates of the new project, select Blank App (Windows Phone) , give some name to the project, for example, let's call it HelloApp. And click OK.

And Visual Studio will create a new project:

The Blank App template project has the following nodes by default:

    The Assets directory containing the image files used

    App.xaml and App.xaml.cs - xaml application resource file and c# application code file, respectively

    MainPage.xaml and MainPage.xaml.cs - application window GUI file and window code file in c#, respectively

    Package.appxmanifest - application manifest file

On this initial stage while files are of value to us MainPage.xaml And MainPage.xaml.cs. Let's open the MainPage.xaml file, which represents the GUI:

On the left, in the form of a phone, we will have a graphic designer window. On the right is the graphical interface markup window in xaml. The graphical interface in this case is represented by the MainPage class, which is a separate page. All interface changes that we make will immediately be displayed in graphic designer, which will give us a visual understanding of how everything will look in the end.

Let's say our application will calculate the amount of the deposit after interest is calculated. To do this, we need a field for entering the amount of the contribution, a field for displaying the result and a button with which we will initiate the calculation of the final amount. So let's change the file code MainPage.xaml in the following way:

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thanks. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!