These tutorials are designed for faculty members in higher education who have worked with XNA and are interested in including Windows Phone 7 (WP7) as part of their courses or research programs. The tutorials are designed to illustrate the details of working with the WP7 sensors. It is assumed that faculty members will have their distinct requirements for abstraction. The tutorials do not attempt to wrap or hide the sensor APIs. The tutorial does not attempt to address any application-level issues (e.g., game-design, game-play), or general issues concerning programming with the XNA Framework. General developers in the XNA community may find the tutorials helpful as an initial guide to working with the sensors on the Windows Phone 7 device.
The material provides a detailed step-by-step guide for setting up the environment to program the WP7 devices.
There are 5 simple tutorials focusing on demonstrating how to work with respective sensors on the phone. The tutorials are loosely related. However it is important to start with the first tutorial on pinch zoom and touch panel because all of the examples require user input and thus require knowledge in decoding user touches or gestures.
The following tutorials are covered in this material.
- Pinch Zoom and Touch Panel (The phone touch screen)
- This program demonstrates XNA programming with the Touch panel. Topics covered in this tutorial include:
- TouchPanel gesture initialization
- Working with the TouchPanel as simple location input device like the mouse: touched, move, release
- Working with the TouchPanel as a multi-touched gesture input device: DoubleTap, Hold, FreeDrag, Pinch, Flick, Hold.
- Orientation (Portrait vs. Landscape)
- This program demonstrates XNA support for changing the phone orientation. Topics covered in this tutorial include:
- Application locking and controlling orientation (and ignores the actual phone orientation)
- Application respect the physical phone orientation and adjusts reference coordinate system accordingly
- Accelerometer (The X/Y/Z accelerometers)
- This program demonstrates XNA support for the accelerometer on WP7. Topics covered in this tutorial include:
- Programming the accelerometer
- The Camera (Camera and photo chooser tasks)
- This program demonstrates XNA support for invoking and obtaining images from the Camera on the phone, and from the "Photo Chooser Task". Topics covered in this tutorial include:
- Invoking the Camera Task
- Invoking the Photo Chooser Task
- Turning an image file on the phone (e.g., a photograph) into a Texture2D
- The GPS (GPS receiver, geo-position and resolving civil addresses)
- This program demonstrates XNA support for working with the GPS on WP7. Topics covered in this tutorial include:
- Programming with GPS Receiver
A very simple library design for the above tutorials is included with this material to hide drawing and font-output details.
- Images hierarchy: simple image with size control: selectable, bounceable and zoomable. Selection and zooming supports arbitrary reference position.
- Fonts: simple output of message
- Vibrate, Song, SoundEffect
To view additional information about Kelvin Sung and this project click here.