Your own application for Windows Phone? Easily! Development of the first application for Windows Phone: Preparing the working environment

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

Architecture overview

Thanks to the common core and UWP app runtime, once written, an app 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 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 different devices, as long as the specific component that the driver is intended for is the same.

UWP supports both kernel-level and user-level drivers. The subsystem includes device driver interfaces (DDI), of which the driver for UWP 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 applications for Windows 10 Mobile, you will need Visual Studio 2015 (who would doubt it). This summer the third update was released. I strongly recommend it! Its main bugfix is ​​reduced memory consumption compared to the second update.

You will also need Windows 10 Anniversary Update SDK: it includes all the necessary tools for developing applications for the entire fleet of devices running 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 makes it easier to implement voice control. The Cortana Actions component in the new API allows you to create new phrases/expressions.

Windows Hello biometric authentication is now available to web developers in the Edge browser.

Blend for Visual Studio 2015, a user interface modeling tool, provides enhanced UI design capabilities over VS. With its help, you can create layouts in XAML for all supported applications: application, web, universal, mobile, and so on. It also contains constructors for additional tasks, including creating animations and controlling the behavior of elements.

Ways to create applications for Windows 10 Mobile

The main way to create applications for smartphones with Windows 10 Mobile is to develop universal (UWP) apps(Scroll Visual C# → Windows → Universal New Project Wizards).

However, he is not the only one. As you know, Xamarin is built into Visual Studio 2015, with its help you can also create applications for Windows 10 Mobile, simultaneously 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, Visual Basic or Visual C++ can be equally selected. VS 2015 allows you to create Universal Apps using JavaScript (JavaScript → Windows → Universal Apps). They can also be deployed to a Windows 10 Mobile device.

Tools for working with legacy projects

Over the long history of the Windows operating system, a colossal number of different applications have been created for it. With the release of Windows 8 and WinRT (and later Windows 10 and UWP), old classic applications are a thing of the past, since only desktop Win 8 and Win 10 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. From this was born Desktop App Converter.

Converting an Xcode project is done in two steps. First you need to add syntax highlighting for the Objective-C language in Visual Studio: install the objc-syntax-highlighting.vsix extension from the winobjc\bin folder. Then, using the command line utility vsimporter.exe, you need to convert the Xcode project into a VS project. After this, 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, it will run just like all other Windows programs.

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

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

If you have a project for a previous version of 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 App (UWP). Not only the user interface markup in XAML will be converted, but also the program logic in JS/C++/C#/VB along with it. 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 using a 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 source project ANGLE. ANGLE (Almost Native Graphics Layer Engine) - an almost native graphics layer engine - allows Windows users to seamlessly run OpenGL ES applications on hardware running DirectX 11. 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 Windows desktop applications.

The issue is discussed in more detail in my book “The Magic of Torque” (again, you’re promoting your book! Well, okay, you deserve it. - Ed.).

Continuation is available only to subscribers

Option 1. Subscribe to Hacker to read all materials on the site

Subscription will allow you to read ALL paid materials on the site within the specified period.

We accept payments by bank cards, electronic money and transfers from mobile operator accounts.

Developing applications for Windows Phone is not that difficult, especially if you are trying to make an application that provides information about services and products or collects data from RSS feeds.

This is a type of application that can be implemented using javascript code in the browser, or using the Access designer, and therefore, to develop such mobile or desktop applications, you do not necessarily need to acquire a full set of tools. A new generation of application builders has arrived, web services that allow you to create and run your own applications. Microsoft recently launched its own studio for creating applications - Windows Phone App Studio

. This is a simple tool that will allow you to create working applications from scratch. For example, to develop a simple application discussed in the article, you will need less than 15 minutes, since this designer provides standard templates. Of course, we are not talking about developing complex programs or games now, but this article will be enough to get you started.

Like Access applications, programs created with Windows Phone App Studio use data connections, that is, they are built on a master/detail view model. You can connect a content feed (be it RSS, Youtube, etc.), or use it to publish your own content. Of course, the application is capable of both at the same time. In addition to feeds, you'll also have the ability to host your own content, whether it's coded HTML pages or pages organized using simple databases that Microsoft calls “collections.” 1. On the first step

We linked our test application to the great-world RSS feed. All we need is the feed URL, and the builder will automatically create a viewport that displays a list of recent articles, as well as a second viewport displaying detailed information about the articles.

However, it is worth noting that the process of creating your own application is not so simple, since the RSS parser used in App Studio sometimes cannot cope with the formatting of the RSS feeds generated by the site. That is, sometimes this can become a real problem, because the text of the article simply will not be displayed, and the ability to debug will be severely limited, as is the case with any cloud development tools.

3. Now, you will need to set title, description, and also set it to 160x160 pixels.

4. Well, the final stage - generation and publication applications. Here's what we got:

At the end, a preview of the created application is available, you can check how it will work on a smartphone or tablet. If everything is fine, click the “Generate” button, a pop-up window will appear:

There are two options to choose from, the first is to generate an application for mobile devices, the second is for tablets and regular PCs. The service takes less than 10 minutes to generate, so you can make a product for each platform in turn. The installation process is very simple thanks to the built-in support for QR codes in Windows Phone. First, you need to install a certificate on your phone, and this is done through a QR code that allows you to download the certificate directly to your phone.

  • To put the resulting miracle on the Windows Phone Store i.e. to the application store, so that anyone, not just you, can download it, you need a developer certificate. It costs about 600 rubles.

It is immediately obvious that this tool is aimed at BYODev scenarios - when you need to quickly get an application without getting involved in a full-fledged development process. Although it is worth noting that you still have the opportunity to download ready-made source codes and use this tool for prototyping before giving them to the development team for revision. You will certainly be able to independently link data sources in the form of collections hosted in the cloud.

This is one of the good reasons why Microsoft allows you to download source code that is ready to run in Visual Studio. It will be bundled into a Visual Studio project and can be imported directly into the desktop IDE and then debugged. Debugging the application using your favorite device simulator will help you quickly identify the problem - the image inserted at the beginning of the article was deleted on the server. You can quickly change the code and the application will work again.

In addition to making debugging easier, access to source code also makes it easier to style the generated code, either by changing templates or by changing data source connections to personal sources. The generated code is all commented and, since it is used as the main development design pattern when creating applications, it will be much easier for you to understand exactly how each individual piece of code works and how to adapt it to your requirements.

One thing is clear about creating such applications: they are not designed to create complex applications. They are like plastic toys for children: everything is in front of us, and we just have to put something together with meaning. As you gain experience through these types of playgrounds, you can gradually move on to formatting the code and use it to create more complex things. With toolkits like Windows Phone App Studio, you can gain specific experience with content-driven apps, RSS feeds, web content, and local content.

Of course, this kit probably doesn't represent everything you'll need to create a commercial application, no matter how simple it might be. But that's not the point, because the generated code gives you a framework to work with, as well as the ability to understand how the application creation process works. One thing is for sure: if you are planning to start developing your own applications, then this is a great place to start. Read further: and?

is an online service for creating mobile applications for different platforms, including Windows Phone. The peculiarity of the service is that to create an application you do not need to program anything - it is tailored for special data consumption scenarios that allow you to generate applications based on the parameters you specify (for example, a news source in the form of an RSS feed).

How it works?

First of all, you will need to register. After this you will be able to get to the control panel (dashboard). Next, choose to create a new application:

To make an application for Windows Phone, select the appropriate option:

On the next screen, indicate the source for your data (a site that has RSS/Atom or a link to the corresponding feed) - I will create an application for our
student blog:

On the right you can immediately see what your application will look like in a phone emulator:

The next point is application customization. Here you can change the application header and also change the colors:

After this, the application is queued for generation - you just have to wait a while until the application is assembled and place it on the Marketplace for everyone!

The finished file generated by appmakr is a regular zip archive that needs to be renamed to a xap file.

If desired, the application can be further customized using CSS and JavaScript.

Publication in Marketplace

Now that you have a ready-made xap file in your hands, it's time to publish the application on the Marketplace. You probably already prepared some of the graphic elements while working on the application (for example, icons and a loading screen), and some will still need to be done for publication in the store.
Let me remind you that undergraduate (and graduate) students can register for the Marketplace for free through the DreamSpark program. Also, until October 20, Softkey has a special promotion for hosting free applications.

The full set of graphics (not all of them are required) looks like this: square icons with widths of 99, 173 and 200px, a background image of 1000x800px, and a set of application screenshots. It is convenient to take screenshots using the emulator's built-in screenshot tool.

Now all that remains is to fill in all the necessary description fields, set the price (for example, make the application free), select markets (note that if the application contains only data in Russian, then it should be published on the Russian market, otherwise there may be difficulties with certification) and submit the application for review.

In a few days, your app will be available in the app store.

Bottom line

If you want to quickly and cost-effectively make an application for Windows Phone,
appmakr will make solving this problem very simple for you! All you need is a browser, data sources, and maybe a few pictures.

Of course, appmakr does not solve all problems and is not able to cover a large number of scenarios. But, at a minimum, to quickly make an application for yourself or friends that aggregates several data sources, or to test for yourself how the entire process of downloading an application and further certification works, appmakr is perfect!

Bonus

Finally, a little bonus. My colleague, Stas Pavlov, will conduct a webinar “Development Basics for the Windows Phone 7 Platform,” which will tell you how to start developing and making money on the Windows Phone 7 platform.

Participation is free. Registration is required.

Before we begin exploring the platform's capabilities and developing applications, we need to make sure that we have all the necessary tools and understand some development basics.

Tools

Visual Studio 2010

To develop for Windows Phone you will need Visual Studio 2010 with Service Pack 1 Professional edition or higher. If you don't have Visual Studio 2010, installing the Windows Phone Development Tools will automatically install the free version of Visual Studio 2010 Express for Windows Phone, which can also be used to develop applications for Windows Phone.

Both versions of Visual Studio Integrated Development Tools provide the developer with the same on-device and emulator debugging capabilities that desktop app developers have on Windows.

Please note that in order to debug on the device, in addition to the device itself and the cable for connecting to the computer, you must have the Zune software (http://zune.net) installed on the computer with the development tools. Also, before deploying the application and debugging, you need to register the device (“unlock” it) using the Windows Phone Developer Registration Tool, which is installed with the Windows Phone SDK.

Windows Phone SDK

This package, available for download on the App Hub website http://create.msdn.com, contains everything you need to start developing. At the time of this writing, the latest version of the toolkit is available in Windows Phone SDK 7.1 Release Candidate under the “Go Live” license, with the ability to develop your own applications and publish them on the Windows Phone Marketplace. Windows Phone SDK 7.1 Release Candidate contains the following components:

  • Windows Phone SDK 7.1
  • Windows Phone Emulator
  • Windows Phone SDK 7.1 Assemblies
  • Silverlight 4 SDK and DRT
  • Windows Phone SDK 7.1 Extensions for XNA Game Studio 4.0
  • Expression Blend SDK for Windows Phone 7
  • Expression Blend SDK for Windows Phone OS 7.1
  • WCF Data Services Client for Windows Phone
  • Microsoft Advertising SDK for Windows Phone

If you do not have Visual Studio 2010 Professional edition, Expression Bland 4, or XNA Game Studio 4.0 installed, the installation process will also download and install:

  • Visual Studio 2010 Express for Windows Phone
  • Expression Blend 4 for Windows Phone
  • XNA Game Studio 4.0

Expression Blend and Expression Blend for Windows Phone

Expression Blend is an interactive visual designer for XAML, the interface description technology for Silverlight and Windows Presentation Foundation (WPF) applications. It's a great development tool that allows you to easily manipulate layers, animations, styles, and templates. This is a basic XAML development tool. Expression Blend itself is not free, but a special version for creating app designs for Windows Phone, called Expression Blend 4 for Windows Phone, is available to developers for free. It will be downloaded and installed during the Windows Phone SDK installation process if you do not have the full version of Expression Blend on your computer. You can read more about Expression Blend 4 on MSDN:

XNA Game Studio 4.0

Windows Phone Emulator

Although Windows Phone Emulator does not contain the full set of applications available on a real device, it provides a powerful environment that allows you to develop an application almost entirely in the emulator.

The Windows Phone Emulator does not support playing Zune media content. The emulator only comes with one built-in Internet Explorer application, but it is Internet Explorer 9 with HTML5 support.

At the same time, the emulator allows you to test calls and send SMS messages, supports multi-touch on monitors that support it, supports the simulation of a camera, geolocation services and accelerometer, and will also allow you to take screenshots.

Additional developer tools

Windows Phone Developer Registration Tool

Windows Phone Profiler

Windows Phone Profiler is available in the Debug menu of Visual Studio with the Windows Phone SDK installed.

Silverlight Toolkit for Windows Phone– A set of useful Silverlight controls for Windows Phone with design mode support, from the Silverlight team. All source code, examples and documentation are available. Updated approximately every three months, available at http://silverlight.codeplex.com or via NuGet.

The current release includes controls such as ContextMenu, DatePicker and TimePicker, ToggleSwitch, WrapPanel and GestureHelper.

Development environment

After installing the Windows Phone SDK, project groups for Silverlight for Windows Phone will appear in the New Project dialog in Visual Studio:

and projects for Windows Phone will be added to the XNA Game Studio 4.0 group:

This series of articles is focused on development for Windows Phone using Silverlight, so we will look at the templates available to application developers in a little more detail.

After installation, the developer has the following Silverlight for Windows Phone application templates at his disposal:

  • Windows Phone Application
  • Windows Phone Databound Application
  • Windows Phone Class Library
  • Windows Phone Silverlight and XNA Application

Before moving directly to application templates, I need to say a few words about Windows Phone and Windows 8-style UI.

Windows Phone and Windows 8-style UI

Windows Phone is not just another platform for mobile devices. It contains not only the technological component, but also a fully developed concept of interface design and user interaction called Windows 8-style UI or Windows 8-style UI style.

If you're a designer or have a dedicated designer on your team, you can take full advantage of the power of Expression Blend 4 or Expression Blend for Windows Phone, which comes with the Windows Phone SDK.

What to do if you are a developer and do not want to deal with the visual design of the application, for example, you are developing a business application and all that is required of it is to comply with the general design and style of Windows Phone?

Everything is very simple. First, Silverlight for Phone is designed with the Windows 8-style UI in mind, so all built-in controls are designed in the Windows 8-style UI style. Secondly, by default, applications created from templates provided by the Windows Phone SDK work, look, and use styles and fonts in accordance with the Windows 8-style UI.

On the other hand, the styling capabilities that Silverlight provides for XAML-based controls and applications are enough to make your application unique and recognizable while remaining within the Windows 8-style UI.

The UI Design and User Experience Guide for Windows Phone can be found at the following link

Everything that was said above applies, of course, to the design of regular applications, since the requirements for the design of gaming applications and their interface may differ significantly. At the same time, we must not forget about the general principles of user interaction inherent in the Windows Phone concept.

Application Templates

First, let's look at three templates that represent the three main styles of a Windows Phone app:

  • Windows Phone Application
  • Windows Phone Pivot Application
  • Windows Phone Panorama Application

Windows Phone Application is an analogue of a simple conversational application that has one main screen through which the main interaction with the user occurs.

Windows Phone Pivot Application is a kind of bookmark application, where the title of each bookmark determines the content. The standard use case is that each bookmark represents essentially the same data, but in different views and/or with different filtering. For example, calendar, email client and phone settings. The template uses a Pivot control.

Windows Phone Panorama Application - a panorama application in which user interaction areas are also divided into panels, but they are accessible through horizontal scrolling; the background image is set to the entire panorama at once, it has a common title that scrolls slower than the panels; the content of the adjacent panel on the right is visible when the current one is displayed. For example, hubs in Windows Phone are implemented in this way: People, Marketplace, Pictures, Music+Videos, etc. The template uses the Panorama control.

Templates ending with Agent are library templates for performing the corresponding background tasks:

  • Windows Phone Audio Playback Agent
  • Windows Phone Audio Streaming Agent
  • Windows Phone Scheduled Task Agent

Windows Phone Databound Application template - a simple application template with a list - a detailed view with the implementation of navigation between pages, passing parameters and storing data in a global ViewModel.

Windows Phone Class Library Template – class library template for Windows Phone.

Windows Phone Silverlight and XNA Application template for a Silverlight application that can use XNA to render graphical content.

Last updated: 10/31/2015

Windows Phone is one of the three most popular operating systems for smartphones today, which creates a need for various kinds of applications for this operating system. And although Windows Phone is still far inferior in popularity to Android or iOS systems, at the same time, the number of devices running this OS is growing in absolute terms, which one way or another creates a need for applications. In addition, there are areas where Windows Phone can compete with other systems, such as business applications.

Let's look at what we need to create applications for Windows Phone 8.1. And we will need the development environment Visual Studio Express 2013 for Windows with a service pack no lower than SP2 (since service packs from SP2 and higher by default contain Windows Phone SDK 8.1). Also, instead of the Express version, we can use another more powerful edition of Visual Studio, such as Visual Studio Community, Professional or Ultimate.

In terms of functionality for development for WP8.1, these releases are not much different, and in the future for all examples I will use Visual Studio Express 2013 for Windows.

In addition to the development itself, we will also need testing tools. Visual Studio provides smartphone emulators by default that you can use for testing. However, to connect emulators, we need to enable virtualization mode in the BIOS, then in Windows we need to enable Hyper-V, which has a number of limitations. In particular, Hyper-V mode is only available for 64-bit versions of Windows 8 Pro and Windows 8 Enterprise. And if your OS is Windows 8 Basic or Windows RT, then you will not be able to use Hyper-V.

In addition, we can naturally use a smartphone with OS Windows Phone 8.1. Although emulators are very convenient: they provide a different range of devices with different settings, testing on real devices gives a complete reliable picture. Therefore, in the future I will use a smartphone as a device.

Before using the smartphone, we have to perform a small procedure to register the smartphone for development.

Phone registration

To register your phone, you need to use the utility that comes with Windows Phone SDK 8.1.

To register your phone, follow a number of steps:

After successfully installing the necessary tools, we will create the first application.