Windows Phone Thoughts: Determine Device Type At Runtime

Be sure to register in our forums! Share your opinions, help others, and enter our contests.


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...



Monday, March 6, 2006

Determine Device Type At Runtime

Posted by Jon Westfall in "DEVELOPER" @ 05:00 AM

http://blogs.msdn.com/davidklinems/.../28/540740.aspx

"There are times when it is useful for an application to know on what type of device it is running. An application may wish to modify it's user interface depending on device type (suppress button controls on SmartPhone devices, for example), or may be part of a test harness and have a need to log the type of device on which testing was performed. On Win32 platforms, including Windows CE, the function SystemParametersInfo provides a mechanism to get and set system-wide parameters on a device. The data returned by SystemParametersInfo (via the pvParam argument) can vary in type. Depending on the system parameter you request, the function can return a string, an integer, a structure, etc. This makes it a difficult function to call from managed code. We can make it using SystemParametersInfo easier by writing type safe wrappers for the specific system parameters of interest. Today's discussion will do just that for SPI_GETPLATFORMTYPE."

Now that it is quite conceivable for developers to have one codebase for their Windows Mobile project (instead of a dedicated PPC and Smartphone base), this handy bit of code may be useful in configuring your device at runtime for optimal experience on whatever device its running on.

Tags:

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...