Windows Phone

Windows Phone is one of the three big Smart Phone operating systems (the others are Android and the Apple IOS). If you already know how to program Windows using C# and WPF or Silverlight, you will find programming the phone pretty straightforward but highly interesting. As well as doing the usual graphical user interfaces, you can access sensor and multi-touch input.
NOTE
This page is under construction
Contents
- Downloads
- Creating Various Required accounts
- Registering your phone
- Recipes, How-To's
- Tutorials and Examples
- Links
Downloading software (if you want to develop on your own Windows machine):
- Install Visual Studio 2010 Professional through the MSDNAA program if you don't have it already.
- Download and install the Windows Phone SDK 7.1.
- Install the Windows Phone SDK 7.1.1 Update.
- Install the Zune software.
- Install the Windows Phone Toolkit
Creating Various Required Accounts
Unlike programming on windows, you need to establish several accounts that will ultimately let you register your phone for application development, and to download programs you develop on your phone.
- Sign up for a Windows Live ID account. You can use an existing account if you already signed up before.
- Register on DreamSpark. Fill out the form. Select the UofC in the field "Institution/School". Finally, click "continue to verify".
- On the next page, enter your UofC email address in order to verify your student status. Once you received the confirmation email, click the link in the email to confirm the student status.
- You now have to link your Windows Live ID to the DreamSpark account. Go to the DreamSpark Windows Phone page (direct link) and click the green button "Map your Live ID".
- On the page that opens up, enter your Windows Live ID account information. The dialog page that opens up, click "Cancel". On the webpage click "OK". Your DreamSpark and Windows Live ID accounts are now linked.
- Register an AppHub account. On the page that opens, click on "Join now - membership registration". Use your Windows Live ID (created during step 1) for this registration. Select "Student" as account type, fill out the rest of the form, and click "I accept"
- On the next page, fill out all your required personal information.
Registering your phone
You will not be able to download applications that you develop to your phone until it is registered. If you are using a Windows Phone that we gave you, we have already registered it so you can skip this step. If you are using your own phone, you must register it yourself.
- Follow all the steps above for downloading software and for creating various required accounts.
- Connect your Windows Phone via your USB cable and unlock it so that you can see the home screen.
- In the start menu, open the "Windows Phone SDK 7.1" and select the "Windows Phone Developer Registration Tool" (This would have been installed as part of the above downloads).
- Once in the registration tool, enter your Windows Live ID account and click "Register" to register the phone for development. Remember, the phone needs to be turned on and the home screen must be visible in order to unlock the device (otherwise you will get an error message).
- You can repeat step 1-3 to unlock up to 3 devices with your AppHub/WindowsLive account.
Note: You will only be able to install approximately 3 of your applications to your phone at a time. If you try to install more, you will get an error message. To remedy this, uninstall one of your applications by pressing and holding its application icon
Recipes and How-To's
CPSC 581 Tutorials
Tutorial 1 (Sept. 10th): GETTING STARTED
- Getting started with Visual Studio, C#, .NET, and Windows Phone programming
- Hello World application
- Download: PhoneAppHelloWorld source code, ZIP
Tutorial 2 (Sept. 12th): UI WIDGETS AND TOUCH
- Introduction to Silverlight, XAML, and Windows Phone programming (PDF, 1.1 MB)
- UI widgets, buttons, radio boxes, labels, using images, transparency loading resources
- Download: PhoneAppHelloWorld2 source code, ZIP
- Download: Photos, ZIP
- Link: MSDN Windows Phone 'HowTo' overview page
- Link: See the book resources listed at the end of this page.
- Multi-touch events, graphics, manipulations and drawing on canvas:
- Download: PhoneAppTouchDraw source code, ZIP
Tutorial 3 (Sept. 17th): SENSORS
- Reading sensors: accelerometer:
- Download: PhoneAppSensors source code, ZIP
- Link: How to read accelerometer data
- Using sensor readings to manipulate graphics:
- Download: PhoneAppSensorsBall source code, ZIP
- Recognizing shake events:
- Download: PhoneAppShakeGestures source code, ZIP
- Download: ShakeGestures library DLL
- Download: ShakeGestures library source code, ZIP
- Link: Shake gestures library in the Windows Phone Blog
- Use shake events in multi-touch drawing application:
Tutorial 4 (Sept. 19th): ANIMATIONS
- Animations in silverlight: animating position of object:
- Download: PhoneAppAnimation source code, ZIP
- Link: Overview of storyboard class
- Link: DoubleAnimation object
- Animating objects with different easing functions, e.g., bounce back:
- Download: PhoneAppBounce source code, ZIP
- Link: BounceEase and easing functions
Tutorial 5 (Sept. 26th): Manipulations
- Another way to manage multi-touch via the Manipulation. They:
- combine the interaction of two fingers into a single action
- are an easy way to combine the movement of one or two fingers into transforms for translation and scaling
- Download: PhoneAppManipulation source code, ZIP
Tutorial 6 (Oct 1): Sounds
- A way to rapidly play multiple sound effects. Note that this is mostly culled from several other examples, so I am not quite sure if what I did is the best way to do it.
- uses the XNA framework, but not that complicated
- note that you need to:
- reference the XNA framework (and add the appropriate Using statements)
- add the sound (and image) files to your solution as a Resource
- for each sound, raise its context menu and mark its Build property as content
- for each image, raise its context men and mark its Build property as resource
- Download: PhoneAppSoundEffects source code, ZIP
Tutorial 7 (Oct 3): GPS and maps
- This tutorial demonstrates how to use the GPS sensor, visualize locations on a map, calculate distance between points, etc.
- Download: PhoneAppMaps source code, ZIP
- KEY: AjQZqlyq2lrOvg_ccfCyhuQzYbtDiF6QDyCj9D5U4ZL3lNhasuO1DI55doWBGZ0L
Other tutorials (for later):
- Data storage
- Read and save sensor readings on the device:
- Download: PhoneAppSensorsLogging source code, ZIP
- Read and save sensor readings on the device:
Tutorial 7 : Changing background images to fill
- SilverlightTapToLoad" in Chapter 4: Bitmaps, Also Known as Textures from the Windows 7 Phone book. Julia found this useful for dynamically changing the background image fill.
Tutorials and Examples
- An Essential Tutorial is provided in the App Hub, where it walks through a variety of short sample programs. Each illustrates basic concepts. Start here!!!
- Code sample collection from AppHub( - also use search filters on the right side to find more content for specific topics)
- Silverlight Windows Phone Toolkit - Source and Samples - the samples in the source illustrate how to use the downloadable extensions (also on this page) including controls, gestural input, etc.
- Nokia's collection of code samples - from the Nokia Developer Forum
Books
- Free programming book for Windows Phone 7 by Charles Petzold
- Note that some of the content changed with recent versions of the Windows Phone SDK; but this is still a great starting point for programming
- PDF version of the book (13 MB, 1013 pages)
- Code samples from the book (5 MB, ZIP)
- EPUB version, MOBI version
- Online books free through UofC library:
- Excellent book: Windows Phone 7.5 Unleashed; by Daniel Vaughan (also might be worth getting a paper copy of this book)
- Windows Phone 7 Development Internals, by Andrew Whitechapel
- Several other Windows Phone 7/7.5 development books (links to Safari-ProQuest search)
Links
- App Hub - Develop for Windows Phone has resources from Microsoft
- Microsoft DreamSpark provides free software to students. A valid account lets you register up to three phone for free. It also includes the Windows Phone and App Hub install which will let you develop phone applications on your own computer.
- Zune Download. Zune is required to sync your phone with your PC, and to download applications you develop from your PC to your phone.
- Microsoft Phone SDK 7.1 works with Visual Studio, if you already have it installed on your home computer. You will need it to develop phone software. Alternately, you can download the Windows Phone and App Hub developer kit from DreamSpark above, which includes Visual Studio 2010 Express.
- Microsoft SilverLight Toolkit download -the Windows Phone Toolkit contains additional controls you can use