160 likes | 171 Views
Windows Forms for mobile development. Tautvydas Dagys. 2009. Do you remember?. Windows Mobile Development. Tools? Challenges? Emulators? Device differences? Windows forms for mobile?. Windows Forms. Windows Forms Development.
E N D
Windows Forms for mobile development Tautvydas Dagys 2009
Windows Mobile Development • Tools? • Challenges? • Emulators? • Device differences? • Windows forms for mobile?
Windows Forms Development • Drag and drop controls from the toolbox to the visible form in the Forms Designer • Consider different screen orientations
Handling Device Differences • Windows Mobile platform & tools • Win32 provides consistent APIs across devices • .NET Compact Framework provides consistent runtime • Also provides specific support for adjusting display • Docking & Anchoring, AutoScroll, and AutoScale • Native provides DeviceResolutionAware.h • Over 20 functions & macros for adjusting application display • Visual Studio 2008 • Integrated orientation & form factor design-time support • Wide variety of emulators • At least one for each supported form factor
Handling Device Differences – Plan of Action • Supporting device differences is fundamental • Decide minimum device profile you wish to support • Touch-screen required? Phone required? Keyboard required? • Abstract application logic from device differences • Separate user interface & application logic as possible • Test across different device types early and often • Take advantage of emulators • Incorporate features from newer platforms / devices • Provide better user experience • Avoid targeting lowest common denominator • Downgrade gracefully for older or more basic devices
Don’t think PocketPC vs Smartphone • Windows Mobile devices are converging • Applications shouldn’t focus on Pocket PC vs Smartphone • The differences between each are becoming subtle • Many Pocket Pcs have phone support • Smartphone screen sizes are increasing • All Windows Mobile devices now have soft-keys • Both PPC & Smartphone may have full keyboard • Think in terms of touch-screen support • Does your app expect stylus-based input? • Can your app be used easily with navigation control & soft-keys? • Does your app require hand-writing support?
Create auto upgrade applications • Create basic nontouch-screen layout • Determine device touch-screen support on startup • Create additional controls when on touch-screen device • Don’t over do it • Focus on easier ways to perform existing features • Avoid introducing entirely new features • Be careful not to change UI too much • Should still feel like the same application
Battery Friendly Development • Win Mobile devices are very powerful • However, they are useless with empty batteries • Decreasing the used power means increasing the battery life • Don’t do anything unless it is absolutely necessary! • When interacting with the user, an application is free to consume as much as necessary • Reducing the “necessary” amount is what performance optimization is all about • In the background, it should consume very little memory, and ZERO battery power
Simple ways to increase battery life • Don’t use the processor • Disable radio’s when not needed • Absolutely don’t use the processor when the application is in the background • Don’t use polling at any time • Limit application functionality when the battery level is low • Don’t keep the backlight on
Standard vs Professional • Windows Mobile Standard • Device can either be on or off • When off nothing works • Windows Mobile Professional • Device can be in suspend mode (sleep) • Separate state between on and suspend, called unattended • When the device seems off it is probably asleep
Using Power Manager • OS Component responsible for meeting the power needs of system • Application interface • Allows communication of power needs • Allows notification of power events • Device interface • Allows drivers to request a change to their power state • Allows PM to set device power state
References • http://msdn.microsoft.com/en-us/windowsmobile/default.aspx • http://msdn.microsoft.com/en-us/rampup/dd807370.aspx