Windows Phone 7 smartphone application development overview

Source: Internet
Author: User
Tags representational state transfer visual studio 2010
ArticleDirectory
    • [Environment installation]
    • [Description]
    • [Description]
    • [Prompt]
    • [Prompt]
    • [Conclusion]
Summary

Windows Phone 7 is a new smart phone operating system launched by Microsoft. It not only has novel user interfaces, but also supports integrating popular social networking websites and microblogs and built-in search functions, location-Based Service, video and music playback, advanced and highly productive game development support, and multi-touch control, it is an important pioneer in Microsoft's mobile phone market. In this article, we will introduce you to the Development of Windows Phone 7 smart phone applications.ProgramTo open the door for developing Windows Phone 7 applications.

[Environment installation]

To develop Microsoft's latest Windows Phone 7 smartphone application, you must first download and install the Windows Phone developer tools suite, use Visual Studio 2010 express provided by Windows Phone developer tools to develop the Windows Phone 7 smart phone application, and deploy the developed application to the Windows Phone Simulator for testing, if you want to develop a smartphone game program, you can also use Microsoft Expression blend for Windows Phone or xNa game studio to develop 2D and 3D game programs. Note that the Windows Phone developer tools suite can only be installed on Windows Vista SP2 or Windows 7 computers, and cannot be a simple version (Starter Edition ). In addition, programmers who want to develop game programs using xNa game studio 4.0 provided by the Windows Phone developer tools suite should note that the Windows Phone developer tools suite does not support installation on any virtual machine, at the same time, the display adapter provided by the computer must comply with the specification defined by DirectX 10 and be equipped with the wddm 1.1 driver.

Hardware support for Windows Phone 7

Windows Phone 7 hardware is different from the previous system in many places, including 800x480 or 480x320 screen resolution, supports multi-touch, built-in A-GPS satellite positioning system (faster response satellite positioning system), g-sensor (accelerometer), Electronic Compass sensor, light source sensor, and the proximity sensor of a nearby object can be detected without direct contact.

Windows Phone 7 smartphones support a digital camera with a minimum of 5 million pixels, built-in codec and multimedia audio and video playback functions, a minimum of 256 mb ram and a minimum of 8 GB of flash memory, GPU (graphics processor ), armv7 cortex/scorpion or better processor, and three hardware buttons back, start, and search.

Software support for Windows Phone 7

Microsoft's latest Windows Phone 7 smartphone mainly requires not only the general public, but also a large number of enterprise users, therefore, we have added support for cloud services in terms of software support. Figure 1 shows the software support for Windows Phone 7. The top shows the runtime and tools, and the bottom shows the cloud-related services. The two constitute the support for developing Windows Phone 7 applications, and support for application execution periods.

Figure 1: software support for Windows Phone 7

As shown in figure 1, apart from the Traditional Visual Studio 2010 express for Windows Phone, the main tool for developing Windows Phone 7 applications can also use expression blend for Windows Phone, no matter which tool is used, you can deploy developed applications to a Windows Phone 7 simulator with simulated GPU (graphics processor-Graphic Processing Unit) capabilities for testing.

Visual Studio 2010 express for Windows Phone can be used to develop applications based on the Silverlight framework, xNa framework, and application debugging and encapsulation. Expression blend for Windows Phone can only be used to develop applications based on the Silverlight framework. It allows Silverlight Application designers to develop Windows Phone 7 applications based on familiar development experience.

In addition to Visual Studio 2010 express for Windows Phone and expression blend for Windows Phone, programmers who want to develop Windows Phone 7 game programs can also use xNa game studio 4.0 to design game programs for Microsoft Windows, Microsoft Xbox 360, Microsoft Zune, and Windows Phone 7. With the help of xNa game studio, Visual Studio 2010 express for Windows Phone can use xNa framework to develop game programs. Of course, Microsoft provides tools for developing Windows Phone 7 applications, as well as related instruction files, teaching files, forums, blogs, technical websites, and rich sample programs, help programmers solve various problems in developing Windows Phone 7 applications.

Windows Phone 7 provides two frameworks: Silverlight framework and xNa framework. The Silverlight framework is an application design concept based on the XAML file. It provides the same development experience as the development of Windows applications and Silverlight applications with the help of the event-driven mechanism. XNa framework is mainly used to support loop-based game programs, that is, to use the loop to constantly update the content displayed on the screen to display smooth game effects.

Both the Silverlight framework and xNa framework are application development architectures on the net platform. They can effectively assist programmers in developing secure smart phone applications, in addition, the programmer only needs to slightly modify the existing Silverlight application or xNa application, such as modifying the screen height and width, and adding the sensor-related functions unique to the smart phone, you can port the Silverlight application or xNa application to Windows Phone 7 for execution.

Using Silverlight framework to develop Windows Phone 7 applications is similar to designing Silverlight applications, A Windows Phone 7 Application Based on the Silverlight framework is composed of a bunch of pages (inherited from the derivative category of the phoneapplicationpage category). Each page has a single extension. a XAML file represents an operating image. A programmer can use Visual Studio 2010 express for Windows Phone or expression blend for Windows Phone to design a page user interface. XNa framework and Silverlight framework are different in that xNa framework is mainly used to support development of game programs, provide 2D/3D animations, sound effects, and various game-related functions, assists companies or individuals interested in developing game programs to develop game programs for Windows Phone, Xbox 360, Zune players, and Windows 7 platforms.

In support of application development, programmers can use the functions provided by the framework to control Windows Phone 7 multi-touch screens, sensors, sound devices, microphones and other hardware, or play sound and film.

In terms of file processing, the Windows Phone 7 application can only access files located in the isolated storage area (isolated storage), and cannot access any files outside the isolated storage area, prevent malware from endangering the operation of other applications or Windows Phone 7.

The location function supported by Windows Phone 7 can be integrated with the location service provided by the cloud service to help applications query the actual location of the device and be notified when the device location changes, determine the direction and speed of device movement, or calculate the distance between two points.

The underlying layer that supports the above features is a complete set of functional frameworks, as shown in 2. The underlying common base class library provides Microsoft. the basic functions of the net platform are also the basis of the Silverlight framework and xNa framework.

Figure 2: Framework for Windows Phone 7 Applications supported

In addition to the framework built in Windows Phone 7, Windows Phone 7 applications can also use cloud services on the Internet, including windows Azure, Xbox Live services, Notification Services, location services, Web Services and WCF services provided by other third parties, and even rest services (representational state transfer, provides richer functions for Windows Phone 7 applications. With the help of cloud services, users can access common data and enjoy the same services when using different computer devices, it is an important foundation for supporting the development of a new generation of mobile computing solutions.

With the help of the cloud service, programmers can not only use more functions than the built-in functions of Windows Phone 7, but also the cloud service is a 24-hour uninterrupted service, it will not be unable to obtain services because the battery power of smart phones is exhausted.

[Description]

Xbox Live is a multi-user online game and digital media delivery service platform developed by Microsoft. It was initially launched for the Xbox gaming platform in November 2002, and then upgraded to support the Xbox 360 platform, the latest Microsoft Zune Portable Media Player and Microsoft Windows platform support Windows Phone 7 smartphones. With the help of the Xbox LIVE service, users can use personal computers, Xbox/Xbox 360 game consoles, Zune players, or Windows Phone smartphones, you can use the same operation interface to conveniently access shared information and services. From the perspective of developing applications, Xbox Live is also an important service that supports the development of game programs across multiple platforms and devices.

In the cloud services provided by Microsoft, the notification service can help Windows Phone 7 applications receive events to be processed in subscription mode, saving the power consumed by regularly querying specific information or status. The location service can use Wi-Fi, cellular, and GPS data to provide location-related functions for Windows Phone 7 applications. In addition, the identity service can provide the authentication function. The feed service can provide the data feed service, the social service can provide the community service, and the map service can provide the map and navigation service.

After the Windows Phone 7 Application is developed, the program designer can use the portal service to publish the developed application to the mobile online software store (marketplace) for users to purchase and use it.

Before uploading a Windows Phone 7 Application to the mobile online software store, you must use the Windows Live account to log on to the mobile online software store and register, after registration, you can use the functions provided by the portal service to upload developed applications to the online software store. The programmer must prepare the application to be uploaded. upload a compressed file in xap format. After the upload is successful, you can query the authentication status of the application and receive the authentication letter after the application passes the authentication of the portal service. Certified applications will be published to the online software store at the price agreed by the programmer for purchase and download by users. If the programmer fixes application errors, adds new features to the application, or develops new applications, the same application authentication program must be repeated, to publish new or modified applications to the online software store.

In addition to selling applications by programmers, the online software store also provides trial APIs to help programmers develop trial applications for users to download and try. In addition, the online software store also provides complete sales reports, user feedback, user opinions on the use of applications, or application errors that the user reflects, and other important information, for the reference of programmers.

Silverlight framework vs xNa framework

After learning about hardware and software support for Windows Phone 7, the programmer must select Silverlight framework or xNa framework as the basis for application development. The framework Architecture Function diagram shown in Figure 3 shows that the underlying layer of Silverlight framework and xNa framework is a group of common services that provide sensor-related functions, location functions, and live service functions, the network communication function, the xNa sound effect API, And the xNa media API are located under this group of shared services. NET Compact framework, composed. NET Compact framework provides basic program development assistance, including data types, XML file processing, integrated query in the LINQ language, isolated storage areas, WCF services, and serialization.

Figure 3: Architecture and functions of Silverlight framework and xNa framework

As shown in figure 3, Silverlight framework and xNa framework share the same nature. The difference is that Silverlight framework and xNa framework support different types of applications. Silverlight framework supports the development of common Windows Phone 7 Applications and provides the controls and display functions required by the program designer to design applications. Of course, it also supports the use of animation functions, xNa framework is mainly used to support programmers to design game-related programs, including assistance in continuously updating and displaying pictures, content pipeline game content processing functions, and 2D/3D graphic display.

[Description]

The content pipeline of xNa framework is a function that creates game content (including texture, Sprite, mesh, effect, Font, music, sound effects, level settings, and role traits, assists programmers in preparing all the game content they need during the game design phase, this prevents the speed of game execution from being affected in order to convert different data formats into the content formats supported by the game.

Figure 4 shows how xNa's content Pipeline Function processes game content:

Figure 4 Process of xNa content pipeline processing game content

As shown in figure 4, after the game content formats in different formats are imported by importer, they are converted to the object formats that can be represented by the content dom (Document Object Model, that is, the format that processor can process. After the content DOM object is processed by processor, It is compiled. content in xNb (short for xNa binary file) format can be loaded and used by games executed on Windows, Xbox 360, or Windows Phone 7.

[Prompt]

XNa's content pipeline feature allows programmers to expand their built-in functionality to handle emerging game content formats or to generate custom output formats.

Table 1 lists the features and applicable application types of the Silverlight framework and xNa framework:

Table 1: Features and applicable application types of Silverlight framework and xNa framework
Functions and features of the Silverlight framework Features of xNa framework
Suitable for developing event-driven applications based on XAML files Suitable for developing highly efficient games
Suitable for application of Silverlight web page development experience to Windows Phone 7 Application Development Suitable for rapid development of 2D and 3D games
Provides control application development and usage The content Pipeline Function is provided to help applications process the game content to be used during game program execution.
Support for audio and video media playback
Supports webbrowser Control for Web browsing, Bing map Silverlight Control for displaying highly interactive maps, and panoramic Control for developing panoramic browsing functions, and the volume control that allows you to browse application pages or data in an axis way.
[Prompt]

After you select the framework to be used for developing a Windows Phone 7 application, the application is not restricted from using the features provided by the other framework, that is to say, applications that use Silverlight framework as the basis for application development can still use the functions provided by xNa framework by referring to components. Otherwise, applications that use xNa framework as the basis for application development can also use the functions provided by Silverlight framework by referring to components.

Create a Windows Phone 7 Application Project

To use Visual Studio 2010 express for Windows Phone to create a Windows Phone 7 Application, you can start Visual Studio 2010 express for Windows Phone and run the [file | new project] function, the screen displays 5 images. In the [Visual C #] project in the left-side window, you can see two types of applications supported by Visual Studio 2010 express for Windows Phone, they are Silverlight for window phone and xNa game studio 4.0.

Figure 5: Create a project using Visual Studio 2010 express for Windows Phone

Select Silverlight for Windows Phone under the [Visual C #] project, select the [Windows Phone application] project type in the window in the middle, and press the [OK] key, you can create a Windows Phone 7 Application Based on the Silverlight framework. After the project is successfully created, you can see the result screen similar to figure 6. Note that the name in the [Solution Explorer] window is mainpage. the XAML file represents the main screen of the application. You can drag the control directly from the [toolbox] window to mainpage. XAML placement, design the operation screen of the application, and the result of editing the operation screen of the application will be reflected in mainpage. when you write an event handler for the controls on the Operation screenCodeWill be automatically added to mainpage. XAML. in the CS file, the overall application development experience should be no stranger to programmers with Windows form application development or Silverlight application development experience.

Figure 6: project content of the Windows Phone 7 Application Based on the Silverlight framework

Programmers who want to develop games using Visual Studio 2010 express for Windows Phone can, after performing the [file | new project] function, select the [xNa game studio 4.0] project type under the [Visual C #] project in the left-side window. Several different game project types are displayed in the right-side window, the options include Windows Phone 7 game-related project types, Windows Platform Game-related project types, Xbox 360 game-related project types, and custom content pipeline extension lib project types, and the empty content project (4.0) project type used to manage game content, as shown in 7:

Figure 7: Visual Studio 2010 express for Windows Phone projects supporting Game Development

Select the [xNa game studio 4.0] project type under the [Visual C #] project in the left-side window, and select the [Windows Phone game (4.0)] project type in the middle window, press the [OK] key to create an xNa framework-based Windows Phone 7 game program. After the project is successfully created, you can see two projects in the [Solution Explorer] window. The project name is [Project nameContent] Is a project responsible for managing game content, and the other is a game program project. 8:

Figure 8: content of the xNa framework-based Windows Phone 7 game program project

You can enable the file named game1.cs in the game program project. This file is the control center of the game. The update method is used to execute the control logic of the game, this includes managing the game status and processing user input data to control game actions. The update method updates the content displayed by the game program.

If you want to use expression blend for Windows Mobile to develop a Windows Phone 7 application, please note that after installing the Windows Phone developer tools suite, expression blend for Windows Mobile tool appears in the [Microsoft Expression] program group. You will not see the tool named expression blend for Windows Mobile in the [Microsoft Expression] program group, because expression blend for Windows Mobile has been integrated with Microsoft Expression blend 4, to use expression blend for Windows Mobile to develop Windows Phone 7 applications, you must start Microsoft Expression blend 4, then, run the [file | new project] function to create a project. Then, you will see the "9" Operation screen:

Figure 9: use Microsoft Expression blend 4 to create an operation screen for the Windows Phone 7 Application

Click the [Windows Phone] project type under the [project types] project in the left-side window, in the right window, you can see the following five Windows Phone application project types created by expression blend for Windows Mobile: windows Phone application, Windows Phone databound application, Windows Phone panorama application, Windows Phone container application, and Windows Phone control library. Select the [Windows Phone application] project type and press the [OK] key to create a project. After the project is successfully created, you will see a picture similar to Figure 10:

Figure 10: content of a Windows Phone application project created using Microsoft Expression blend 4

You can use the controls provided by the [tools] window to design applications, use the [properties] window to set the properties of controls, design the functions of the application, and press the F5 function key to execute the created application, expression blend for Windows Mobile loads the designed application to the Windows Phone Simulator for testing.

[Conclusion]

Windows Phone 7 is a new smart phone operating system launched by Microsoft. It not only has novel user interfaces, but also supports integrating popular social networking websites and microblogs and built-in search functions, location-Based Service, video and music playback, advanced and highly productive game development support, and multi-touch control, it is an important pioneer in Microsoft's mobile phone market.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.