views:

291

answers:

3

Hi! I have used the SystemState.PhoneRadioPresent to determine if the device is a standard or professional, but isn't that just for determine if it is a pocketpc or a smartphone.

I have a smartphone with no touchscreen or mouse, and i have two GUI's. One that handles mobile devices with touchscreen or mouse, and the other one which handles smartphones with just keyboard.

How can i determine what kind of mobile device it is?

thanks in advance

+2  A: 

How to: Get the Device Platform

hjb417
But this is not what i wanted. I can get the same with SystemState.PhoneRadioPresent.What i need to know is whether the phone is a standard or professional phone.
A: 

You don't mention which version of the .NET CF you are targeting so I'll cover all cases :-)

For pre .NET CF 3.5 take a look at a blog post of mine "What device is my application running on" available at http://www.christec.co.nz/blog/archives/77. It covers a number of platform/device type detection scenarios.

In your case P/Invoke the SystemParametersInfo API and request the SPI_GETPLATFORMTYPE parameter. You will get a string back which is "SmartPhone" (Windows Mobile Standard) or "PocketPC" (Windows Mobile Professional or Classic).

A sample application is available for download from the blog post I mentioned.

If you are using .NET CF 3.5 it's even easier, as the BCL was updated to include this handy feature. Take a look at the SystemState.Platform property. It is a simple enumerated type with values such as WinCEPlatform.Smartphone and WinCEPlatform.PocketPC.

i.e.

if (SystemSettings.Platform == WinCEPlatform.Smartphone)
   MessageBox.Show("I am on a standard device");
else
   MessageBox.Show("I am on a professional or classic device");

Reviewing the links provided by hjb417 the information provided there is also correct. Some of the confusion here may be the fact that Microsoft changed their operating system naming conventions a number of times in the past few years.

The old names were Smartphone and PocketPC, which map to the newer names as follows

SmartPhone = Windows Mobile Standard (no touchscreen)
PocketPC = Windows Mobile Professional (phone) or Windows Mobile Classic (no phone)

These names have all just recently changed yet again to "Windows Phone".

Christopher Fairbairn