WP and Programming Basics

Content "filtered", Please subscribe for FULL access.

Chapter 2 : WP & Programming Basics

Introduction arrow_upward

  • Microsoft leveraged existing frameworks for the Windows Phone application platform.
    • Programs are written in Visual Basic (VB) and VC#.
    • Programs run on the .Net framework.
  • .NET provides a common base class library
    • This ensures code reuse.
  • .NET provides support for many common programming tasks:
    • Multithreading
    • XML
    • LINQ collections
    • Events handling
    • Data handling
    • IO
    • Networking
    • Globalization
    • Runtime security
    • Diagnostics
  • The Windows Phone application platform consists of two major frameworks:
    • Silverlight
    • XNA


  • Silverlight is used for applications and simple 2D games.
  • Silverlight uses the XAML (Extensible Application Mark-up Language).
  • XAML is a declarative mark-up language for creating compelling UI.

  • XNA:

  • XNA is primarily used for creating games.
  • The XNA framework comes with a game engine that allows game creation.
  • XNA provides a 3D engine, allowing developers to create 3D games.

  • Minimum Hardware Requirements for WP arrow_upward

  • Capacitive, 4-point multi-touch screen with WVGA (800 x 480) resolution.
  • 1 GHz ARM v7 processor.
  • DirectX9 rendering-capable GPU.
  • 256 MB of RAM with at least 8 GB of Flash memory.
  • Accelerometer, compass, ambient light sensor, proximity sensor, GPS and gyroscope.
  • 5-megapixel camera with an LED flash.
  • FM radio tuner
  • 6 dedicated hardware buttons
    • Back
    • Start
    • Search
    • Camera
    • Power/sleep
    • Volume Up and Down

    Silverlight for WP arrow_upward

  • Silverlight was mainly designed for rich web applications:
    • Silverlight is leveraged for creating applications for the mobile platform.
  • Silverlight uses XAML
    • XAML provides vector-based graphics.
    • XAML provides powerful data binding feature to the application controls.

    XNA for WP arrow_upward

  • XNA was originally designed for creating games for Xbox.
    • It is also a good choice for creating Windows Phone games (Windows Phone has Xbox LIVE integration)
  • XNA provides a rich framework for 3 dimensional game developments.

  • User Interface of WP arrow_upward

  • Windows Phone uses a novel user interface called Metro.
    • Metro is a UI vision.
    • It is an internal code name for a typography-based design language.
  • It is a clean and simple design with emphasis on color and typography.
  • Windows Phone consists of dynamic tiles (Live tiles) that display critical information at a glance to the user.
  • The tiles are dynamic:
    • They can portray the up-to-date status of the application.
  • WP introduced hubs.
    • Hubs bring related information together
  • Hubs that come with Windows phone. are:
    • People
    • Pictures
    • Music
    • Videos
    • Marketplace
    • Office
    • Games
  • Visual elements and direct manipulation of objects by touch are the key characteristics of the WP application.

  • Application UI for WP arrow_upward

  • Applications on WP need to adopt the metro design guideline.
  • The WP development tools and SDK include a rich collection of Silverlight controls designed specifically for usability.

  • WP UI Controls arrow_upward

  • Windows Phone introduces innovative UI controls.
    • Panorama control is a multi-screen page. It allows a page to span horizontally beyond the width of the phone.
    • Pivot control is useful to manage views and display information that is logically divided into vertical sections.

    WP Notifications and Navigation arrow_upward

  • Notifications play a key role in WP.
  • The tiles can show notifications.
  • The notification service can display “toast” notifications that provide time sensitive information.
    • Example: SMS
  • They are used to display non-critical information without disrupting what the user is doing.
  • On WP the hardware back button allows the user to navigate back between pages within an application or across applications.

  • Introduction to C# arrow_upward

  • C# (Pronounced "C sharp") is a programming language designed by Microsoft to combine the power of C/C++ and the productivity of Visual Basic.
  • C# is a multi-purpose computer programming language suitable for a wide variety of development needs.
  • C# is one of the languages used in the Microsoft .NET Framework.

  • .NET Framework arrow_upward

  • The Microsoft .NET Framework is a library of objects that create or draw things on the computer.
  • C# is the language developed to create code for the .Net framework and the .Net framework contains all for the execution of programs coded in C#.
  • The .Net framework is an environment specifically developed for the development and execution of highly distributed and component based application.
  • It enables different programming languages to work together and provides features for the Microsoft Windows platform like
    • Security
    • Program portability
    • Common programming model

    VB.NET and C#.NET arrow_upward

  • Visual Basic .NET and Visual C# .NET, both are programming languages that are based on the Microsoft .NET Framework, and they are equally powerful.
  • Visual Basic .NET is a true object-oriented programming language that includes new and improved features such as:
    • Inheritance
    • Polymorphism
    • Interfaces
    • Overloading
  • Both Visual Basic .NET and Visual C# .NET uses the common language runtime.
  • There are almost no performance issues between Visual Basic .NET and Visual C# .NET.
  • Visual C# .NET may have a few more "power" features such as handling unmanaged code, and Visual Basic .NET may be skewed a little toward ease of use by providing features such as late binding.
  • The differences between Visual Basic .NET and Visual C# .NET are very small compared to what they were in earlier versions.

  • Introduction to Managed Programming using C# arrow_upward

  • WP supports managed programming in C# or VB.NET.
  • The C# compiler (or VB compiler) compiles the C# or VB.NET code into an intermediate language (IL) byte code and metadata.
  • It uses metadata to manage type safety, exception handling and array bounds.
  • Below flow chart provides steps involved in running a managed program.

  • C# Blocks arrow_upward

  • Blocks of code occur between open and closed curly braces.
  • You are able to create blocks to follow a series of steps to satisfy a certain task or condition.
  • Parameters created in a block get disposed when control jumps out of the block.
  • if(test == 0)
    int s = 0;

    C# Console.WriteLine Method arrow_upward

  • Write Line can display text and string variables code.
  • Console.WriteLine ("WAGmobCode");

  • This code simply writes WAGmobCode to the screen.

  • C# Console.Write Method arrow_upward

  • Console.Write is slightly different then Console.WriteLine.
  • Write does not go to the next line when multiple “Console.Write” commands are given.
  • Instead the cursor remains on the same line until you tell it to go to the next line by using a carriage return.
  • Code:
    Console.Write ("WAGmobApps_");
    Console.Write ("WAGmob Code");

    WAGmobApps_WAGmob Code

    Thank You from Kimavi arrow_upward

  • Please email us at Admin@Kimavi.com and help us improve this tutorial.

  • Mark as Complete => Receive a Certificate in Windows-Phone-Programming

    Kimavi Logo

    Terms and conditions, privacy and cookie policy

    Kimavi @ YouTube | Email Admin @ Kimavi | Visit TheCodex.Me

    Beautiful Educational Videos for School, College, Languages & Encyclopedia

    Learn Python with 500,000 students

    Created with Love