260 likes | 380 Vues
Adding life and intelligence to Windows Mobile 6.5 Applications. Andrej Radinger , MVP APPA Mundi Ltd. www. appamundi . com andrej@appamundi.com MOB303. About Andrej Radinger. Director for Consulting and Training at APPA Mundi Microsoft MVP for Mobile Devices since 2004
E N D
Adding life and intelligence to Windows Mobile 6.5 Applications Andrej Radinger, MVP APPA Mundi Ltd. www.appamundi.com andrej@appamundi.com MOB303
About Andrej Radinger • Director for Consulting and Training at APPAMundi • Microsoft MVP for Mobile Devicessince 2004 • Regularspeaker on Microsoft eventsintheregion • Contact me at: andrej@appamundi.com • Mobile Services: Consulting, Development, Training • http://www.appamundi.com
Assumptions & Disclaimers • This is a level 300 session! • You already know the basics of Windows Mobile development with .NET Compact Framework • Making things easy: • Windows Mobile 6 Professional = Pocket PC • Windows Mobile 6 Standard = Smartphone • All demos in this session apply to bothWindows Mobile 6.1 & 6.5 • Based on hardware-specific APIs
Agenda • Windows Mobile Device Input Options • Mobile UI Design Guidelines & Best Practices • Next Generation Input for Devices • Unified Sensor API (Codeplex) • Working with Accelerometers • Working with Light Sensors • Detecting Simple Touch Screen Gestures • Provide Sensory Feedback to Users • Summary
Windows Mobile Device Form Factors • Pocket PC (including Pocket PC Phone) • Tactile screen, stylus, standard buttons • QWERTY Keyboard: Built-in, “slideable”, none • Smartphone • Numeric keypad or full QWERTY keyboard • No stylus, cursor keys • Industrial/Embedded • “Ruggedized” Pocket PCs • Numeric/Alphanumeric keypads • Handheld PC • Clamshell, Tablet-style • VGA, ½-VGA screen • QWERTY Keyboard
Understanding the Windows MobileUser Interface • Limited Screen Real Estate • Limited Memory Environment • Touch-Sensitive Screen on Pocket PCs:Stylus or Finger Input • Soft Input Panel (Pocket PC) • Hardware Keys • Built-in/slideableKeyboards(on certain models) • Numeric Keypad (Smartphone) • Voice Commands
Key User Interface Principles • Design a new UI for a mobile device,don’t port your desktop UI • Completely redesign the user interface • Business logic may be reusable • Choose the correct model based on the form factor • Pocket PC should always be full-screen • Limit free text entry on devices with no keyboards • Keep the user interface simple • Avoid control overcrowding • Limit the required number of clicks as much as possible • Take advantage of new UX hardware options!
New UX Hardware Options • User Experience (UX) includes input & output • Touch Screen Gestures • Feedback via Vibration • Feedback via Sounds • Accelerometers • Light Sensors • Navigation Wheels • Capacitive Touch Screens* • Not featured on any Windows Mobile device announced to date
Unified Sensor API • Allows developers to easily access the hardware sensors that are available on various devices • Accelerometer (GSensor) • Light Sensor • Stylus Sensor • Navigation Wheel • CodePlex Open Source Community Project • http://sensorapi.codeplex.com • Created by Koushik K. Dutta • http://www.koushikdutta.com • Devices: HTC Touch*, Samsung Omnia/Instinct
Accelerometer: GSensor • Return a device orientation vector • The vector is the direction of force relative to the orientation of the device. • Tilt X: 0 is flat, -1000 to +1000 • Tilt Y: 0 is flat, -1000 to +1000 • Tilt Z: 0 is straight up, -1000 is flat, 1000 is face down • Switch between landscape/portrait mode • Can be used to as an alternative to4-way cursor keys +Y -X -Z +Z +X -Y
Demo Unified Sensor API Working with the Accelerometer using GSensor
Light Sensor • Return the ambient luminance based on a device’s light sensor • Single numerical value • Ranges from 0 to 30 • Change UI color scheme based onambient lighting • Create a new light sensor with HTCSensorOpen(HTCSensor.Light)in HTCSensorSDK.dll
Demo Unified Sensor API Detecting Ambient Lighting with LightSensor
Touch Screens & Gestures • Windows Mobile devices use a resistive touch screen: single touch point • Can detect simple gestures using the “mouse” events in .NET Compact Framework • Stylus and fingers fire mouse events in Compact Windows Forms • MouseDown: Capture the start position • MouseUp: Detect end position, calculate direction, even the distance if needed • Track the position with MouseMove if the user goes off-screen
Demo Detecting Simple Screen Gestures Tracking the Stylus with “Mouse” Events in WinForms
Providing Feedback to the User • Visual Cues on Screen • Playing Sounds • Vibrating the device
Demo Vibration Providing vibration feedback to the user
Playing Sound in NETCF 3.5 // Play custom sound files with SoundPlayer Dim soundplayer As New Media.SoundPlayer With soundplayer .SoundLocation = "\My Documents\My Ringtones\murloc.wav" .Play() End With // Play standard system sounds Media.SystemSounds.Asterisk.Play() Media.SystemSounds.Beep.Play() Media.SystemSounds.Exclamation.Play() Media.SystemSounds.Hand.Play() Media.SystemSounds.Question.Play()
Summary • Users expect more from their mobile devices • Create a next generation user experience (UX) • Tap into the advanced hardware capabilities of your Windows Mobile devices • Make your device application input intuitive • Use simple gestures to add another layer of interaction to your mobile application • Provide audible and sensory feedbackto your users • Download and test drive the Windows MobileUnified Sensor API from CodePlex
Additional Resources Windows Mobile Developer Center @ MSDN Online http://msdn.microsoft.com/en-us/windowsmobile/default.aspx Koushik Dutta’s Blog: My Brain Hurts http://www.koushikdutta.com Microsoft Mobile Development Handbook By Andy Wigley, Daniel Moth, Peter Foot – Microsoft Press (2007)
question & answer Andrej Radinger, MVP APPA Mundi www.appamundi.com andrej@appamundi.com
Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Resources • www.microsoft.com/teched Sessions On-Demand & Community • www.microsoft.com/learning • Microsoft Certification & Training Resources • http://microsoft.com/technet • Resources for IT Professionals • http://microsoft.com/msdn Resources for Developers
Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!
Required Slide © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.