280 likes | 414 Views
Session Code. Camera & Sensors in Windows Phone Application. Larry Lieberman Product Mgr , Windows Phone Developer Microsoft Corporation. Agenda. What sensors are available, and how do I use them? How do I access the camera to address various scenarios.
E N D
Session Code Camera & Sensors in Windows Phone Application Larry Lieberman Product Mgr, Windows Phone Developer Microsoft Corporation
Agenda • What sensors are available, and how do I use them? • How do I access the camera to address various scenarios
New scenarios enabled in Windows Phone 7.5 • Augmented reality • Barcode scanning apps • Custom cameras • Image processing
What hardware sensors are supported? • Accelerometer • Compass • Gyro New for 7.5
Motion sensor All the sensors + a bunch of math! Motion Sensor Use this sensor whenever available
Why not always use motion sensor? • Motion.IsSupported is false • Motion will work even without gyroscope • When you want data specific to the sensor reading • Accelerometer – acceleration (in g’s) • Gyro –rotational velocity (rad/s) • Compass – heading (degrees) • Advanced Usages • Custom motion algorithms • Gestures • ?
Two Ways to Access the Camera • PhotoCamera Class: • New ISV Managed API developed for WP • Silverlight 4 WebCam API • Ported SL4 API with added functionality and perf
Camera “Good to Know” • Output for Video recorded is MP4 • Always check for device specific support for Flash mode • Use Y or YUV format for Processing Samples
Hardware Availability and Debugging • Not all phones will have same hardware configuration • Gyro and Compass optional (but if Gyro present, Compass present) • Motion Sensor quality based on sensors present • Accelerometer, Gyro, and Compass - best quality • Accelerometer and Compass – good for AR scenarios(reduced quality without Gyro) • Physical hardware required for most debugging scenarios • Accelerometer can be debugged with emulator
Re-cap • Gyro, compass, and motion sensor are coming • The new motion sensor class does all the hard math for you • You can still access raw sensor data if you need to • New camera API’s will enable cool new scenarios on the phone • Augmented Reality • Customer Photo Camera Questions?
Summary • Many of the most compelling mobile applications and games leverage sensors to create wildly interactive experiences
Feedback Your feedback is very important! Please complete an evaluation form! Thank you!
Questions? • Session Code • Speaker Name • Title • Email • Blog • … • You can ask your questions at “Ask the expert” zone within an hour after end of this session
Session Code Company Name Company Title of Presentation Name
Session Code Company Name Company Name Company Title of Presentation Name
Slide Title • First level • Second level • Third level • Fourth level • Fifth level
PowerPoint Guidelines • Font, size, and color for text have been formatted for you in the Slide Master • Use the color palette shown below • Hyperlink color: www.microsoft.com Sample Fill Sample Fill Sample Fill Sample Fill Sample Fill Sample Fill
Demo Title Name demo
Video Title video
Announcement Title announcement
Code Sample • Get-Process –computername srv1 • class TechEdProgram • { • public static void Main() • { • System.Console.WriteLine("Hello, Tech·Ed!"); • } • }