To develop a WP application, you must first build a development environment. The following describes how to build a development environment for WP.
1. Download the Windows Phone SDK:
Windows Phone SDK (software development kit), now the latest version is version 7.1, please go to http://www.microsoft.com/downloads/zh-cn/details.aspx? Familyid = 0a373422-6680-46a7-89e1-e9a468a14259 & displaylang = ZH-CN download and install. Please select the language version. Generally, you can select Simplified Chinese, if you like the English version or want to exercise your English, you can also select the English version. At present, Microsoft promises to give free use to developers.
This toolkit contains the following components:
- Microsoft Visual Studio 2010 learning edition for Windows Phone
- Windows Phone emulator
- Windows Phone SDK 7.1 assembly
- Silverlight 4 SDK and DRT
- Windows Phone SDK 4.0 extension for xNa game studio 7.1
- Microsoft Expression blend SDK for Windows Phone 7
- Microsoft Expression blend SDK for Windows Phone OS 7.1
- WCF Data Services Client for Windows Phone
- Microsoft advertising SDK for Windows Phone
Ii. system requirements:
The following are the standard configurations and operating system requirements for developing WP programs. Before installing the software, you must know whether your computer configurations and operating system versions meet the requirements to avoid delay.
- Supported Operating Systems: Windows 7 and Windows Vista
- Windows Vista (x86 and x64) Service Pack 2-All versions except Starter Edition
- Windows 7 (x86 and x64)-All versions except Starter Edition
- The installation requires 4 GB of available disk space on the system drive.
- 3 GB memory
- Windows Phone emulator requires a graphics card that supports DirectX 10 or later with the wddm 1.1 driver.
- Windows Phone SDK 7.1 is compatible with the final version of Visual Studio 2010 SP1.
Note: 1. the Windows Phone emulator simulator must support DirectX 10 graphics cards. Otherwise, you cannot debug game programs developed with xNa. applications developed with Silverlight will also be affected.
2. If vs 2010 has been installed on your computer, you must upgrade vs 2010 to SP1 before installing the wp sdk.
Iii. Installation Process:
1. Click setup.exe to install,
2. Click "Install now" to install it now. Of course, you can also select "customize". However, the only difference you can change is the installation path, which is installed in the programe Files folder of drive C by default, to save trouble, click Install now. Next, we will accept the license agreement,
3. Select "accept" to start installation,
Next:
4. The installation is complete. The program requires a restart. Click "restart now" to complete the operating system installation,
4. The first Windows Phone program:
After the development tool is installed, how can we check whether the installation is successful? The best way is to establish a program test. By the way, let's take a look at how to start the first WP program in the environment we set up, wow, it's so exciting!
1. Start Visual Studio 2010 express for Windows Phone. The interface is as follows:
2. Click "new project" to create a new project named hellowp ,:
Note: There are two projects, Silverlight for Windows Phone and xNa game studio 4.0. We currently use the Silverlight for Windows Phone project, which is mainly used for application development, while xNa is mainly used for game development.
3. Click OK to go to the main interface of the project ,:
4. The function we want to implement here is to click a button to change the text of pagetitle, so the code we want to modify is as follows:
1 <! -- Titlepanel contains the application name and page title -->
2 <stackpanel X: Name = "titlepanel" grid. Row = "0" margin = ",">
3 <textblock X: Name = "applicationtitle" text = "My first WP program" style = "{staticresource phonetextnormalstyle}"/>
4 <textblock X: Name = "pagetitle" text = "Hello WP" margin = "9,-7,0, 0" style = "{staticresource phonetexttitle1style}"/>
5 </stackpanel>
5. Add another <button> In the <stackpanel> panel and add the click event to modify the text attribute of pagetitle. The modified code is as follows:
1 <stackpanel X: Name = "titlepanel" grid. Row = "0" margin = ",">
2 <textblock X: Name = "applicationtitle" text = "My first WP program" style = "{staticresource phonetextnormalstyle}"/>
3 <textblock X: Name = "pagetitle" text = "Hello WP" margin = "9,-7,0, 0" style = "{staticresource phonetexttitle1style}"/>
4 <button X: Name = "mybutton" Click = "mybutton_click"> click me </button>
5 </stackpanel>
The background code is as follows:
1 private void mybutton_click (Object sender, routedeventargs E)
2 {
3 pagetitle. Text = "success! ";
4}
After debugging, you can see the following results in the simulator:
Click the button.
The above is the establishment of the WP Development Environment summarized today and the first WP program we have implemented. The next article will summarize the concepts related to Windows Phone development, thank you!