0

I need to retrieve the following information from the device to be used in a testing and analytics App:

Device Name eg. MyPhone1,
Device Manufacturer eg. Nokia,
Device Processor,
Device Processor Type eg. ARM,
Device RAM,
Device supported networks eg. GSM,HSDPA,LTE,
Device OS eg. Windows,
OS Version eg 8.1,
Device Screen Size eg. 4.7 inch,
Device Screen Resolution eg 1920X1080,
PPI Density eg. 336,
Density Type eg. XHDRI,
Device Model eg. Lumia 920,
Device Build

I have been looking for a solution since over a week but all the code samples/answers I find are related to either WP8 or WP8.1 Silverlight. Please direct me on how I can gather the above information for WINDOWS 8.1 RUNTIME APPS?

I'm using C# and .NET 4.5

blagnom650
  • 47
  • 7
  • Is the question about Windows PHONE or not? If it is, what's wrong with using the same samples as for WP8? There is no significant difference. If it *isn't*, please remove references to phone from the title and tags – Panagiotis Kanavos Feb 13 '15 at 12:09
  • @PanagiotisKanavos Yes It is about Windows Phone. Adding the WP8 samples results in namespace errors. The classes referenced in the code don't seem to exist in the WP8.1 runtime context. – blagnom650 Feb 13 '15 at 12:13
  • And these are ...? What have you tried? – Panagiotis Kanavos Feb 13 '15 at 12:15
  • I tried using `DeviceExtendedProperties` class but it's namespace `Microsoft.Phone.Info` is not available when I try to use it in the App. Please forgive me for asking seemingly obvious questions. I'm a noob. – blagnom650 Feb 13 '15 at 12:18
  • DeviceExtendedProperties is a WP7.0 class, [deprecated](https://msdn.microsoft.com/library/windows/apps/microsoft.phone.info.deviceextendedproperties(v=vs.105).aspx) by WP7.1. As the docs say, you should use the [DeviceStatus](https://msdn.microsoft.com/el-gr/library/windows/apps/microsoft.phone.info.devicestatus(v=vs.105).aspx) class, supported in WP7.1-8.1, with [examples here](https://msdn.microsoft.com/en-US/library/windows/apps/ff941122(v=vs.105).aspx). If you can't find the namespace, make sure you do have a reference to the `Microsoft.Phone.dll` – Panagiotis Kanavos Feb 13 '15 at 12:27
  • Thank you @PanagiotisKanavos Seems like I was missing a reference to the `Microsoft.Phone.dll`. I added the reference and now all the properties of the `DeviceStatus` class are accessible. But now I'm facing a new issue _Error: Cannot find type System.Windows.Controls.ContentControl in module System.Windows.dll_ while compiling. – blagnom650 Feb 13 '15 at 13:08
  • In Windows XAML apps the ContentControls lives in the [Windows.UI.Xaml.Controls](https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.contentcontrol) namespace. Sounds like you copied some XAML code from a WPF application – Panagiotis Kanavos Feb 13 '15 at 13:37
  • I downloaded the dll from [here](https://code.google.com/p/ngenerics/source/browse/trunk/Source/Dependencies/WindowsPhone/Microsoft.Phone.dll?r=316) and added the reference manually. I tried doing it in a new Blank App (Windows Phone). It still results in the same error. The app compiles fine without adding the reference. – blagnom650 Feb 13 '15 at 14:20
  • Found a solution [here](http://igrali.com/2014/07/17/get-device-information-windows-phone-8-1-winrt/)! – blagnom650 Apr 10 '15 at 19:52

0 Answers0