Windows Phone Development Environment

.Requirements for Windows Phone Development

Computer Clip Art, Public Domain

Requirements for Windows Phone Development

"SLAT is part of the chipset required to run the WP 8.0 emulator (Hyper-V). The WP 8.0 emulator will not run on a virtual machine".

  • The development computer for Windows Phone 8.0 applications must have the following capabilities:
    • Windows 8 operating system, 64-bit (x64) client versions
    • 8 GB free disk space
    • 4 GB of Ram (recommended)
    • 64-bit (x64) CPU
    • Further, the Windows Phone 8.0 Emulator requires Windows 8 Pro or higher (Enterprise)
    • Additionally, the Windows Phone 8.0 Emulator requires a Second Level Address Translation (SLAT) compatible chipset.
    • Note: It is still possible to install the WP SDK 8.0 and develop apps for Windows Phone 8.0 without the higher versions of Windows 8 and/or no SLAT chipset. However you will only be able to debug and test the apps on a registered Windows Phone 8.0 device.
  • Second Level Address Translation (SLAT)
    • SLAT is a hardware-assisted virtualization technology required to run Microsoft's Hyper-V. Hyper-V is a native hypervisor (virtual machine monitor) for x86-64 systems and is used by the WP 8.0 emulator.
    • The WP 8.0 emulator will NOT run on a virtual machine, because Hyper-V is already a virtual machine.
    • To test if a computer supports SLAT, download SysInternals/TechNet CoreInfo and run

       "coreinfo -v"

    • If an asterisk appears next to the "EPT" label, then the SLAT chipset was found, otherwise the computer does not contain the needed chipset requirements for the WP 8.0 emulator.
  • SLAT and AMD Processors
    • Note: I had an AMD processor, which indicated SLAT with an "NP" (instead of "EPT" as does Intel chips).
    • AMD has a List of AMD Processors with Rapid Virtualization Indexing Required to Run Hyper-V in Windows 8
    • CPU-Z is a freeware utility which will display the type of processor a computer contains, plus other hardware related information.
.Windows Phone Developer Registration

Computer Clip Art, Public Domain

Windows Phone Registration

"Before any test applications can be installed on a Windows Phone, the phone needs to be unlocked by registering it with Microsoft."

  • A "developers unlock" on a Windows Phone device is obtained by registering the device with Microsoft. To register a device you will need:
    • a Microsoft account.
    • a current developer account on Windows Phone Dev Center (a.k.a. The App Hub).
    • to register your phone with Microsoft using the Windows Phone Developer Registration tool. This is a stand-alone tool that’s installed as part of the Windows Phone SDK. The program is located in the Windows Phone SDK 8.0 directory.
    • to follow these steps using the Windows Phone Developer Registration tool:
      1. Turn on your phone and unlock the phone screen.
      2. On the phone, ensure that the date and time are correct.
      3. Connect the phone to a development computer by using the USB cable that came with the phone.
      4. Under Windows Phone SDK, click Windows Phone Developer Registration.
      5. After the screen indicates the phone has been detected, press the Register button. The screen should indicate you have unlocked the Windows Phone.
      6. Once the Windows Phone has been unlocked and registered with Microsoft, you can deploy test applications to the phone.
      7. Installing applications on a test device is called side-loading.
      8. You can have up to 10 applications side-loaded on a test phone at one time.


Software Development Kits

" WP SDK 8.0 and WP SDK 7.1 have different operating system requirements, different hardware requirements, and are compatible with different versions of Visual Studio."

  • Windows Phone Software Development Kits (WP SDK) are full-featured development environments for Windows Phone applications. As of September 2013, the two WP SDKs used by developers are versions 7.1 and 8.0.

  • WP SDK 8.0 and WP SDK 7.1 have different operating system requirements, different hardware requirements, and are compatible with different versions of Visual Studio:
    • WP SDK 8.0 is the latest WP SDK version (as of September 2013). WP SDK 8.0:
      • Is compatible with Visual Studio 2012
      • Requires Windows 8 operating system or higher (Windows 8 Pro or higher for WP 8 emulator, plus SLAT)
      • Can target, build, and test apps for both OS 8.0 and OS 7.1
      • Will NOT target OS 7.0 (An OS 7.0 app is automatically upgraded to target OS 7.1).
    • WP SDK 7.1 is a prior WP SDK version still in use. WP SDK 7.1:
      • Is used compatible Visual Studio 2010
      • Requires Windows Vista SP 2, or higher (Plus DirectX 10 or higher graphics card)
      • Can target, build, and test apps for OS 7.1 and OS 7.0.
  • When installing one of the WP SDK's, if there is a compatible version of Visual Studio already on the computer (eg. Professional, Premium, Ultimate), then the WP SDK will be installed as an add-on to Visual Studio. If no compatible version of Visual Studio exists on the computer, then the compatible version of "Visual Studio Express for Windows Phone" will be installed.

  • Windows Phone SDKs come with a special version of Silverlight called Silverlight for Windows Phone. The WP Silverlight version contains additional support for touch input, and does not contain support for the HTML DOM bridge. For more information on Silverlight for Windows Phone, see the article Silverlight for Windows Phone .

  • After the SDK has been installed, Visual Studio will include several project templates for Windows Phone applications. The templates provide good starting points when developing new Windows Phone applications.
,Windows Phone Project Templates

Windows Phone Project Templates, Fair Use



Visual Studio

"#define VISUAL_STUDIO => You can use Visual Studio to build Windows Store apps, desktop apps, mobile apps, ASP.NET web apps, and XML web services. You can write code in Visual Basic, Visual C#, Visual C++, Visual F#, and JavaScript, and create mixed-language solutions."

  • Visual Studio is a suite of component-based software development tools and other technologies for building applications. The upper versions of Visual Studio also include team-based design, development, and deployment.

  • Visual Studio 2012 is the most recent version available (as of September 2013). All versions of Visual Studio 2012 require Windows 7 operating system or higher. All the paid versions of Visual Studio 2012 are available with a free 30 day trial, extendable to 90 days when you register to obtain a free-trial product key. For Windows Phone development there are different versions of Visual Studio 2012 available:
    1. Visual Studio Express 2012 for Windows Phone
      • $0.00
      • Must register the software within 30 days, but then there are no other time limitations. No cost or expiration date.
      • Provides free tools for developers building apps and games for Windows Phone using .NET or DirectX/C++.
      • Is one of the components in the Windows Phone SDK, along with the other free tools needed for Windows Phone development.
      • Contains a full functioning Windows Phone emulator and Windows Phone Store Test Kit.
      • Limitations: The Express edition does NOT:
        • support plugins (No ReSharper, no add-ons)
        • support the creation of web services
        • contain features found in higher versions of Visual Studio such as: team development, source control integration, macros, code profiling, test framework, or report creation.
      • Additionally, the Express edition has a reduced number of project templates and reduced support for: refactoring, design and database tools.
      • Also, the Express edition doesn't let you have different project types in a single solution. The expression editions are defined by the project types they target (Web, Windows Desktop, Windows Phone).
    2. Professional (with MSDN 2012)
      • $1,199.00 Retail
      • Is designed for individual developers and small teams.
      • The Professional edition includes numerous features:
        • Same IDE to create solutions for the web, desktop, cloud, server, and phone
        • Extensive tools for app debugging and profiling
        • Unit testing and an extensible testing framework
        • Team Foundation Server
        • Support for the cloud, Windows Store, and Windows Phone Store.
    3. Premium (with MSDN 2012)
      • $6,119.00 Retail
      • Is designed for team development.
      • With Visual Studio Premium 2012, you’ll track every task and role in your business and development teams.
      • In addition to the features of the Professional version, the Premium version also includes:
        • Provision and manage virtual lab environments for testing with consistent configurations
        • Coordinate your team with agile project management tools
        • Organize and define your test plans with test case management and exploratory testing
        • Improve code quality with a peer code review workflow within Visual Studio
        • Improve developer productivity when multitasking with task suspend and resume
        • Automate user interface tests to validate application UI
        • Find and manage duplicate code in your code base to improve your architecture
        • Determine how much code is being tested with code coverage analysis.
    4. Ultimate (with MSDN 2012)
      • $13,299.00 Retail
      • Is designed for development teams of any size. State-of-the-art toolset for enterprise development.
      • Includes architectural, prototyping, and management tools. Plus a powerful testing infrastructure and advanced collaboration.
      • In addition to the features of the Premium version, the Ultimate version also includes:
        • Reliably capture and reproduce bugs found during manual and exploratory testing to eliminate "no repro" bugs
        • Understand the dependencies and relationships in your code through visualization
        • Visualize the impact of a change, or a potential change in your code
        • Collect and analyze runtime diagnostic data from production systems
        • Perform unlimited web performance and load testing
        • Design architectural layer diagrams to then validate code implements the architecture.

Visual Studio Files

"Resource files are typically any non-executable data files used by your application, such as image, audio, and video files."

  • Visual Studio creates various files which contain the components of a WP app. Visual Studio files include:
    1. Code Files - (*.cs and *.vb) contain the C# or Visual Basic source code.
    2. XML Files - (*.xaml) contains Microsoft's variant of XML (XAML) used mostly to create the user interface.
    3. XAP Files - (.xap) a compress file (.zip format) that contains everything needed to run the app.
    4. Image Files - JPEG and PNG are the image formats used in WP apps. They are both generally small in size and support millions of colors:
      1. JPEG - (*.jpeg, *.jpg) are Joint Photographic Experts Group. JPEG files are lossy, that is they will degrade when enlarged.
      2. PNG - (*.png) are Portable Network Graphics. PNG files are lossless, that is they allow a certain degree of enlargement without a degradation in quality. PNG should be used for transparent images (they support opacity and transparent backgrounds).
    5. Resource Files - Resource files are typically non-executable data files used by an application, such as image, audio, and video files. A resource file can also have specific meanings in certain contexts. For example, in the context of application localization, resource files refer to .resx files.
      • Resource files can be deployed in the following ways:
        1. as individual files in the application package
        2. as individual files that you retrieve on demand
        3. as files embedded in an assembly in the application package
        4. as files embedded in an assembly in an external library package
        5. as files embedded in an assembly that you retrieve on demand.
      • Resource files are configured for deployment in the Build Action values in Visual Studio:
        1. Resource - this build action will embed the file in the project assembly. Resource built files are loaded automatically when the DLLs that contain them are loaded. Note: Resource files can affect the length of time an application needs to start.
        2. Content - this build action will include the file in the application package only, without embedding it in the project assembly. Content built files are loaded when you access them. Use this option for resource files shared by multiple assemblies in the package.
        3. None - this build action will not include the file in the application package nor embed the file in the project assembly. Use this option for resource files that you want to retrieve on demand. You will typically deploy on-demand files at the same server location as your application package.
,IntelliSense Code Snippet

IntelliSense Code Snippet Insert, Fair Use

IntelliSense

"Intellisense can create code snippets from short cuts. Enter the short name and then press the TAB key twice. I works like a macro which replaces the snippet shortcut with the actual snippet of code."

  • IntelliSense is the general term for a number of features: List Members, Parameter Info, Quick Info, and Complete Word. These features help you to learn more about the code you are using, keep track of the parameters you are typing, and add calls to properties and methods with only a few keystrokes.
    • Many aspects of IntelliSense are language-specific.
    • IntelliSense options can be changed under Tools/Options/Text Editor.
    • Some useful Intellisense short cuts include:
      • Ctrl + K, Ctrl + W - Intellisense, invokes intellisense for current cursor position.
      • Ctrl + Space - Complete Word, completes the rest of a variable, command, or function name once you have entered enough characters to disambiguate the term.
      • Ctrl + I - Quick Info, displays the declaration syntax and description. You may also get this information with a mouse over.
      • Ctrl + . - Generate Code, use when the code is marked as an error. Select the code generation desired to resolve the error. You can also click on the little blue box under the code, but it can be difficult than using the keyboard shortcut.
Code Generation
  • Code can be generated upon request from menu options: (Edit, Intellisense, Insert Snippet..) and (Edit, Intellisense, Generate).
    • Intellisense can also create code snippets from short cuts. You enter the short name and then press the TAB key twice. I works like a macro which replaces the snippet shortcut with the actual snippet of code. For example:

       type: prop, then TAB + TAB, to insert this code snippet for automatically creating a property => public int MyProperty { get; set; }

    • Code can also be generated to resolve a detected error (Ctrl + .). You can also click on the little blue box under the code, but it can be difficult to select on the small blue box, so sometimes it is easer to use the keyboard shortcut.


.Keyboard Shortcuts

Computer Clip Art, Public Domain

Visual Studio 2010 Keyboard Shortcuts

Keys Action

General

F1 Context Help.
Ctrl - MouseWheel Change size of displayed fonts and also change size of design surface.

IntelliSense

Ctrl-K, Ctrl-W IntelliSense.
shortCut-TAB-TAB Insert code snippet (eg. ShortCut = "try" will generate a catch-try block code snippet).
Ctrl + Space Complete Word, completes once enough characters entered to disambiguate the term.
Ctrl + I Quick Info, displays the declaration syntax and description.
Ctrl + . Generate Code, use when the code is marked as an error. Select the code generation desired to resolve the error.

Editor

Ctrl-K, Ctrl-C Comments current line or selected block of lines.
Ctrl-K, Ctrl-U Remove comments from current line or selected block of lines.
Ctrl-F Displays the Find dialog.
F3 Finds the next occurrence of the previous search text
Ctrl-S Saves selected files in the current project.
Ctrl-Shift-S Saves all documents and projects.

Navigation

F4 Displays the Properties window.
F7 Switches from design view to code view.
Shift-F7 Switches from code view to design view.
Shift-Alt-Enter Toggles full screen mode.

Debugging

F5 Debug, or continue in debug mode.
Shift-F5 Stop debugging.
F11 Step Into.
F10 Step Over.
Shift-F11 Executes the remaining lines of a function.
Ctrl-Shift-B Builds the solution.

Macros

Ctrl-Shift-R Start/Stop macro recording.
Ctrl-Shift-P Play macro.

Meta Data

F12 When on data type (String, Array) will provide meta data definition.




Reference Articles