This topic provides step-by-step
instructions to help you create your first app for Windows Phone. You’re
going to create a basic web browser. This simple app lets the user
enter a URL, and then loads the web page when the user clicks the Go button.
You can download the complete Mini-browser Sample in C# or in Visual Basic.NET.
This topic contains the following sections.
You can download the complete Mini-browser Sample in C# or in Visual Basic.NET.
This topic contains the following sections.
This
walkthrough assumes that you’re going to test your app in the emulator.
If you want to test your app on a phone, you have to take some
additional steps. For more info, see How to register your phone for development for Windows Phone 8.
The steps in this topic assume that you’re using Visual Studio Express 2012 for Windows Phone. You may see some variations in window layouts or menu commands if you’re using Visual Studio 2012 Professional or higher, or if you’ve already customized the layout or menus in Visual Studio.
The steps in this topic assume that you’re using Visual Studio Express 2012 for Windows Phone. You may see some variations in window layouts or menu commands if you’re using Visual Studio 2012 Professional or higher, or if you’ve already customized the layout or menus in Visual Studio.
The first step in creating a Windows Phone app is to create a new project in Visual Studio.
To create the project
- Make sure you’ve downloaded and installed the Windows Phone SDK. For more information, see Get the SDK.
- Launch Visual Studio from the Windows Start screen. If the Registration window appears, you can register the product, or you can temporarily dismiss the prompt.
- Create a new project by selecting the FILE | New Project menu command.
- In the New Project window, expand the installed Visual C# or Visual Basic templates, and then select the Windows Phone templates.
- In the list of Windows Phone templates, select the Windows Phone App template.
- At the bottom of the New Project window, type MiniBrowser as the project’s Name.

- Click OK. In the New Windows Phone Application dialog box, select Windows Phone OS 8.0 for the Target Windows Phone OS Version.
- When you select Windows Phone OS 8.0 as the target version, your app can only run on Windows Phone 8 devices.
- When you select Windows Phone OS 7.1, your app can run on both Windows Phone OS 7.1 and Windows Phone 8 devices.

- Click OK. The new project is created, and opens in Visual Studio. The designer displays MainPage.xaml, which contains the user interface for your app. The main Visual Studio window contains the following items:
- The middle pane contains the XAML markup that defines the user interface for the page.
- The left pane contains a skin that shows the output of the XAML markup.
- The right pane includes Solution Explorer, which lists the files in the project.
- The associated code-behind page, MainPage.xaml.cs or MainPage.xaml.vb, which contains the code to handle user interaction with the page, is not opened or displayed by default.

The
next step is to lay out the controls that make up the UI of the app
using the Visual Studio designer. After you add the controls, the final
layout will look similar to the following screenshot.

Your layout is now complete. In the XAML code in MainPage.xaml,
look for the grid that contains your controls. It will look similar to
the following. If you want the layout exactly as shown in the preceding
illustration, copy the following XAML and paste it to replace the grid
layout in your MainPage.xaml file.

To create the UI
- Open the Properties window in Visual Studio, if it’s not already open, by selecting the VIEW | Properties Window menu command. The Properties window opens in the lower right corner of the Visual Studio window.
- Change the app title.
- In the Visual Studio designer, click to select the MY APPLICATION TextBlock control. The properties of the control are displayed in the Properties window.

- In the Text property, change the name to MY FIRST APPLICATION to rename the app window title. If the properties are grouped by category in the Properties window, you can find Text in the Common category.
- In the Visual Studio designer, click to select the MY APPLICATION TextBlock control. The properties of the control are displayed in the Properties window.
- Change the name of the page.
- Change the supported orientations.
- In the XAML code window, click the first line of the XAML code. The properties of the PhoneApplicationPage are displayed in the Properties window.
- Change the SupportedOrientations property to PortraitOrLandscape to add support for both portrait and landscape orientations. If the properties are grouped by category in the Properties window, you can find SupportedOrientations in the Common category.
- Open the Toolbox in Visual Studio, if it’s not already open, by selecting the VIEW | Toolbox
menu command. The Toolbox typically opens on the left side of the
Visual Studio window and displays the list of available controls for
building the user interface. By default the Toolbox is collapsed when
you’re not using it.

- Add a textbox for the URL.
- From the Common Windows Phone Controls group in the Toolbox, add a TextBox control to the designer surface by dragging it from the Toolbox and dropping it onto the designer surface. Place the TextBox just below the Mini Browser text. Use the mouse to size the control to the approximate width shown in the layout image above. Leave room on the right for the Go button.
- In the Properties window, set the following properties for the new text box.
With these settings, the control can size and position itself correctly in both portrait and landscape modes.Property Value Name URL Text http://www.xbox.com TextWrapping NoWrap Height Auto Width Auto HorizontalAlignment Stretch VerticalAlignment Top
- Add the Go button.
- Resize the text box to make room for the Go button. Then, from the Common Windows Phone Controls group in the Toolbox, add a Button control by dragging and dropping it. Place it to the right of the text box you just added. Size the button to the approximate width shown in the preceding image.
- In the Properties window, set the following properties for the new button.
With these settings, the control can size and position itself correctly in both portrait and landscape modes.Property Value Name Go Content Go Height Auto Width Auto HorizontalAlignment Right VerticalAlignment Top
- Add the WebBrowser control.
- From the All Windows Phone Controls group in the Toolbox, add a WebBrowser
control to your app by dragging and dropping it. Place it below the two
controls you added in the previous steps. Use your mouse to size the
control to fill the remaining space.
If you want to learn more about the WebBrowser control, see WebBrowser control for Windows Phone 8. - In the Properties window, set the following properties for the new WebBrowser control.
With these settings, the control can size and position itself correctly in both Portrait and Landscape modes.Property Value Name MiniBrowser Height Auto Width Auto HorizontalAlignment Stretch VerticalAlignment Stretch
- From the All Windows Phone Controls group in the Toolbox, add a WebBrowser
control to your app by dragging and dropping it. Place it below the two
controls you added in the previous steps. Use your mouse to size the
control to fill the remaining space.
<!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <TextBox x:Name="URL" Margin="10,10,85,0" Text="http://www.xbox.com" VerticalAlignment="Top"/> <Button x:Name="Go" Content="Go" HorizontalAlignment="Right" Margin="346,10,0,0" VerticalAlignment="Top"/> <phone:WebBrowser x:Name="MiniBrowser" Margin="10,82,0,0"/> </Grid>
The final step before testing your app is to add the code that implements the Go button.
To add the code
- In the designer, double-click the Go button control that you added to create an empty event handler for the button’s Click event. You will see the empty event handler in a page of C# code on the MainPage.xaml.cs tab, or in a page of Visual Basic code on the MainPage.xaml.vb tab.
When you double-click the Go button, Visual Studio also updates the XAML in MainPage.xaml to connect the button’s Click event to the Go_Click event handler.using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; using MiniBrowser.Resources; namespace MiniBrowser { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); } private void Go_Click(object sender, RoutedEventArgs e) { } } }
<Button x:Name="Go" Content="Go" HorizontalAlignment="Right" Margin="346,10,0,0" VerticalAlignment="Top" Click="Go_Click"/>
- In MainPage.xaml.cs or MainPage.xaml.vb, add the highlighted lines of code to the empty Go_Click event handler. This code takes the URL that the user enters in the text box and navigates to that URL in the MiniBrowser control.
Now you’ve finished your first Windows Phone app! Next you’ll build, run, and debug the app.
Before you test the app, make sure that your computer has Internet access to be able to test the Web browser control.
Congratulations! You’ve now successfully completed your first Windows Phone app.
Before you test the app, make sure that your computer has Internet access to be able to test the Web browser control.
To run your app in the emulator
- Build the solution by selecting the BUILD | Build Solution menu command.
If any errors occur, they’re listed in the Error List window. You can open the Error List window, if it’s not already open, by selecting the VIEW | Error List menu command. If there are errors, review the steps above, correct any errors, and then build the solution again. - On
the Standard toolbar, make sure the deployment target for the app is
set to one of the values for the Windows Phone Emulator, for example, Emulator WVGA 512MB.

- Run the app by pressing F5 or by selecting the DEBUG | Start Debugging
menu command. This opens the emulator window and launches the app. If
this is the first time you’re starting the emulator, it might take a few
seconds for it to start and launch your app.
The Windows Phone 8 Emulator has special hardware, software, and configuration requirements. If you have any problems with the emulator, see the following topics.
- To test your running app, click the Go button and verify that the browser goes to the specified web site.

- To test the app in landscape mode, press one of the rotation controls on the emulator toolbar.
Or 
The emulator rotates to landscape mode. The controls resize themselves to fit the landscape screen format.

- To stop debugging, you can select the DEBUG | Stop Debugging menu command in Visual Studio.
It’s better to leave the emulator running when you end a debugging session. The next time you run your app, the app starts more quickly because the emulator is already running.
Get started developing for Windows Phone.
Windows Phone 8 replaces the Windows CE-based architecture used in Windows Phone 7 with the Windows NT kernel found in Windows 8. Current Windows Phone 7 devices cannot run or update to Windows Phone 8 and new applications compiled specifically for Windows Phone 8 are not made available for Windows Phone 7 devices. Developers can make their apps available on both Windows Phone 7 and Windows Phone 8 devices by targeting both platforms via the proper SDKs in Visual Studio [6]
Windows Phone 8 devices are manufactured by Nokia, HTC, Samsung and Huawei.[7]
Contents
History
On June 20, 2012, Microsoft unveiled Windows Phone 8 (codenamed Apollo), a third generation of the Windows Phone operating system for release later in 2012. Windows Phone 8 replaces its previously Windows CE-based architecture with one based on the Windows NT kernel, and shares many components with Windows 8, allowing developers to easily port applications between the two platforms.Windows Phone 8 also allows devices with larger screens (the four confirmed sizes are "WVGA 800×480 15:9","WXGA 1280×768 15:9","720p 1280×720 16:9","1080p 1920x1080 16:9" resolutions) and multi-core processors, NFC (that can primarily be used to share content and perform payments), backwards compatibility with Windows Phone 7 apps, improved support for removable storage (that now functions more similarly to how such storage is handled on Windows and Android), a redesigned home screen incorporating resizable tiles across the entire screen, a new Wallet hub (to integrate NFC payments, coupon websites such as Groupon, and loyalty cards), and "first-class" integration of VoIP applications into the core functions of the OS. Additionally, Windows Phone 8 will include more features aimed at the enterprise market, such as device management, BitLocker encryption, and the ability to create a private Marketplace to distribute apps to employees[8][9]—features expected to meet or exceed the enterprise capabilities of the previous Windows Mobile platform.[10] Additionally, Windows Phone 8 will support over-the-air updates, and all Windows Phone 8 devices will receive software support for at least 36 months after their release.[11]
In the interest of ensuring it is released with devices designed to take advantage of its new features,[12] Windows Phone 8 will not be made available as an update for existing Windows Phone 7 devices. Instead, Microsoft released Windows Phone 7.8 as an update for Windows Phone 7 devices, which backported several features such as the redesigned home screen.
Addressing some software bugs with Windows Phone 8 forced Microsoft to delay some enterprise improvements, like VPN support, until the 2014 release of Windows Phone 8.1.[13]
Support
In March 2013, Microsoft announced that updates for the Windows Phone 8 operating system would be made available through July 8, 2014. Microsoft pushed support up to 36 months, announcing that updates for the Windows Phone 8 operating system would be made available through January 12, 2016.[14] Windows Phone 8 devices will be upgradeable to the next edition of Windows Phone 8.1.[15]Features
HTC Windows Phone 8X and Nokia Lumia 920 running Windows Phone 8
Core
Windows Phone 8 is the first mobile OS from Microsoft to use the Windows NT kernel, which is the same kernel that runs Windows 8. The operating system adds improved file system, drivers, network stack, security components, media and graphics support. Using the NT kernel, Windows Phone can now support multi-core CPUs of up to 64 cores, as well as 1280×720 and 1280×768 resolutions, in addition to the base 800×480 resolution already available on Windows Phone 7. Furthermore, Windows Phone 8 also adds support for MicroSD cards, which are commonly used to add extra storage to phones. Support for 1080p screens was added in October 2013 with the GDR3 update.Due to the switch to the NT kernel, Windows Phone 8 also supports native 128-bit Bitlocker encryption and Secure Boot. Windows Phone 8 also supports NTFS due to this switch.[19]
Web
Internet Explorer 10 is the default browser in Windows Phone 8 and carries over key improvements also found in the desktop version. The navigation interface has been simplified down to a single customizable button (defaults to stop / refresh) and the address bar. While users can change the button to a 'Back' button, there is no way to add a 'Forward' button.Multitasking
Unlike its predecessor, Windows Phone 8 uses true multitasking, allowing developers to create apps that can run in the background and resume instantly.[20]A user can switch between "active" tasks by pressing and holding the Back button, but any application listed may be suspended or terminated[21] under certain conditions, such as a network connection being established or battery power running low. An app running in the background may also automatically suspend, if the user has not opened it for a long duration of time.
The user can close applications by opening the multitasking view and pressing the "X" button in the right-hand corner of each application window, a feature that was added in Update 3.[22]
Kids Corner
Windows Phone 8 adds Kids Corner, which operates as a kind of "guest mode". The user chooses which applications and games appear on the Kids Corner. When Kids Corner is activated, apps and games installed on the device can be played or accessed without touching the data of the main user signed into the Windows Phone.[17]Rooms
Rooms is a feature added specifically for group messaging and communication. Using Rooms, users can contact and see Facebook and Twitter updates only from members of the group created. Members of the group can also share instant messages and photos from within the room. These messages will be shared only with the other room members.[17]Driving Mode
With the release of Update 3 in late 2013, pairing a Windows Phone 8 device with a car via Bluetooth now automatically activates "Driving Mode", a specialized UI designed for using a mobile device while driving.Data Sense
Data Sense allows users to set data usage limits based on their individual plan. Data Sense can restrict background data when the user is near their set limit (a heart icon is used to notify the user when background tasks are being automatically stopped).[23] Although this feature was originally exclusive to Verizon phones in the United States, the GDR2 update released in July 2013 made Data Sense available to all Windows Phone 8 handsets.NFC and Wallet
Select Windows Phones running Windows Phone 8 add NFC capability, which allows for data transfer between two Windows Phone devices, or between a Windows Phone device, and a Windows 8 computer or tablet, using a feature called "Tap and Send".In certain markets, NFC support on Windows Phone 8 can also be used to conduct in-person transactions through credit and debit cards stored on the phone through the Wallet application. Carriers may activate the NFC feature through SIM or integrated phone hardware. Orange will be first carrier to support NFC on Windows Phone 8. Besides NFC support for transactions, Wallet can also be used to store credit cards in order to make Windows Phone Store and other in-app purchases (that is also a new feature), and can be used to store coupons and loyalty cards.[24]
Syncing
The Windows Phone app succeeds Zune Software as the sync application to transfer music, videos, other multimedia files and office documents between Windows Phone 8 and a Windows 8/Windows RT computer or tablet. A version for OS X and Windows Desktop app is also available.Due to Windows Phone 8 identifying itself as an MTP device, Windows Media Player and Windows Explorer may be used to transfer music, videos and other multimedia files unlike in Windows Phone 7. Videos transferred to a computer are limited to a maximum size of 4 GB.[25]
Other features
- Xbox SmartGlass allows control of an Xbox 360 and Xbox One with a phone (available for Windows Phone, iOS and Android).
- Xbox Music+Video services support playback audio and video files in Windows Phone, as well as music purchases. Video purchases were made available with the release of a standalone version of Xbox Video in late 2013 that can be downloaded from the Windows Phone Store.
- Native code support (C++)
- Simplified porting of Windows 8 apps to Windows Phone 8 (compatibility with Windows 8 "Modern UI" apps)
- Remote device management of Windows Phone similar to management of Windows PCs
- VoIP and video chat integration for any VoIP or video chat app (integrates into the phone dialer, people hub)
- Firmware over the air for Windows Phone updates
- Minimum 36 month support of Windows Phone updates to Windows Phone 8 devices.
- Camera app now supports "lenses", which allow third parties to skin and add features to camera interface.
- Native screen capture is added by pressing home and power buttons simultaneously.
- Hebrew language support is added for Microsoft to introduce Windows Phone to the Israeli market.[26]
Hardware specifications
| Windows Phone 8 minimum device specifications |
|---|
| Qualcomm Snapdragon S4 dual-core processor or Snapdragon 800 (as of Update 3) |
| Minimum 512 MB RAM for WVGA phones; minimum 1 GB RAM for 720p / WXGA / 1080p |
| Minimum 4 GB flash memory |
| GPS and A-GNSS; GLONASS is supported, if OEMs decide to include it |
| Support for micro-USB 2.0 |
| 3.5 mm stereo headphone jack with three-button detection support |
| Rear-facing AF camera with optional LED or Xenon flash, optional front-facing camera (both need to be VGA or better) and dedicated camera button |
| Accelerometer, proximity and ambient light sensors, as well as vibration motor (magnetometer and gyroscope are optional) |
| 802.11b/g and Bluetooth (802.11n is optional) |
| DirectX graphics hardware support with hardware acceleration for Direct3D using programmable GPU |
| Multi-touch capacitive touch screen with minimum of four simultaneous points |
Windows Phone 8 update history
Update 1 (GDR 1, Portico)
General Distribution Release 1, a minor update known as Portico was rolled out on December 2012 that brought some improvements and bugfixes, including enhancements in Messaging, more efficient Bluetooth connectivity, and an "always-on" setting for WiFi connections, among other additional platform updatesUpdate 2 (GDR 2)
Microsoft rolled out a package of minor updates called "General Distribution Release 2" (GDR 2), beginning in July 2013 and spanning the following months, depending on the manufacturer and carrier. Along with this update Nokia released its own update which updated the firmware of the user, namely Lumia Amber, which was available for only Lumia phones. The update brought many camera improvements and fixed some bugs in the cameras of existing Lumia phones.Update 3 (GDR 3)
On October 14, 2013, Microsoft released the third General Distribution Release update for Windows Phone 8, which would roll out to phones over the following months. Windows Phone Developers were among the first to receive the update under a new Developer Preview Program.Table of versions
| Previous release | Current release | Preview release |
| [hide]Table of versions: Windows Phone 8 | ||
|---|---|---|
| Version | Release date | Changes |
8.0.9903.10 (Apollo) | ||
| 29 October 2012 |
|
|
8.0.10211.204 (GDR 1) |
| 11 December 2012 |
|
|
8.0.10327.77 (GDR 2) |
|
Also called: 8.0.10328.78 (GDR 2)[28] |
12 July 2013 |
|
|---|---|---|
8.0.10512.142 (Update 3) |
|
Also called: 8.0.10501.127, 8.0.10517.150, 8.0.10521.155[28][29] |
14 October 2013[30] |
|
|---|---|---|
8.0.10532.166 |
| 14 April 2014 |
|
|
| Version | Release date | Changes |
Reception
Reviewers generally praised the increased capabilities of Windows Phone 8, but noted the smaller app selection when compared to other phones. Brad Molen of Engadget mentioned that "Windows Phone 8 is precisely what we wanted to see come out of Redmond in the first place," and praised the more customizable Start Screen, compatibility with Windows 8, and improved NFC support. However, Molen also noted the drawback of a lack of apps in the Windows Phone Store.[31] The Verge gave the OS a 7.9/10 rating, stating that "Redmond is presenting one of the most compelling ecosystem stories in the business right now," but criticized the lack of a unified notifications center.[32] Alexandra Chang of Wired gave Windows Phone 8 an 8/10, noting improvement in features previously lacking in Windows Phone 7, such as multi-core processor support, faster Internet browsing, and the switch from Bing Maps to Nokia Maps, but also criticized the smaller selection of apps.[33]Usage
IDC reported that in Q1 2013, the first full quarter where WP8 was available to most countries, Windows Phone market share jumped to 3.2% of the worldwide smartphone market, allowing the OS to overtake BlackBerry OS as the third largest mobile operating system by usage.[34]Roughly a year after the release of WP8, Kantar reported in October 2013 that Windows Phone grew its market share substantially to 4.8% in the United States and 10.2% in Europe.[35] Similar statistics from Gartner for Q3 2013 indicated that Windows Phone's global market share increased 123% from the same period in 2012 to 3.6%.[36]
In Q1 2014 IDC reported that global market share of Windows Phone has dropped to 2.7%.[37]
No comments:
Post a Comment