Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

information about windows phone (model number)

i want to know the device model number programmatically as it is shown in settings about page about page

i am currently using

Microsoft.Phone.Info.DeviceStatus.DeviceName

but it doesn't help and gives some other typical value. Please help me how can i get phone model/name as above.

like image 952
Jatin Avatar asked Jul 02 '13 11:07

Jatin


2 Answers

You should use PhoneNameResolver, a simple class that resolves the obscure devices names like

RM-885_apac_prc_250

into friendlier commercial names like

NOKIA Lumia 720

Here is a sample code:

var phone = PhoneNameResolver.Resolve(
    DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);
SomeTextBox.Text = phone.FullCanonicalName;

More info in this blog post: http://devblog.ailon.org/devblog/post/2013/01/21/Introducing-PhoneNameResolver%E2%80%93a-lib-to-decipher-Windows-Phone-models.aspx

like image 81
Olivier Payen Avatar answered Oct 20 '22 01:10

Olivier Payen


you can use a function like this:-

        public static string getDeviceInfo(bool asList = false)
    {
        string r = "";

        Geolocator locationservice = new Geolocator();

        if (DeviceNetworkInformation.CellularMobileOperator != "") r += "CellularMobileOperator: " + DeviceNetworkInformation.CellularMobileOperator + Environment.NewLine;
        r += "CellularDataEnabled: " + DeviceNetworkInformation.IsCellularDataEnabled + Environment.NewLine;
        r += "WiFiEnabled: " + DeviceNetworkInformation.IsWiFiEnabled + Environment.NewLine;
        r += "IsNetworkAvailable: " + DeviceNetworkInformation.IsNetworkAvailable + Environment.NewLine;
        r += "Hardware Identifier: " + Convert.ToBase64String((byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId")) + Environment.NewLine;
        r += "Location Services Permission: " + locationservice.LocationStatus + Environment.NewLine;

        r += "Language: " + CultureInfo.CurrentCulture.EnglishName + Environment.NewLine;
        r += "Locale: " + CultureInfo.CurrentCulture.Name + Environment.NewLine;
        //r += "Background Service Enabled: " + ScheduledActionService.Find("PeriodicAgent").IsEnabled + Environment.NewLine;
        r += "Runtime Version: " + Environment.Version + Environment.NewLine;
        r += "Maximum Memory: " + (DeviceStatus.DeviceTotalMemory / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Maximum Memory Available: " + (DeviceStatus.ApplicationMemoryUsageLimit / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Peak Memory Use: " + (DeviceStatus.ApplicationPeakMemoryUsage / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Charger: " + DeviceStatus.PowerSource + Environment.NewLine;
        r += "DeviceFirmwareVersion: " + DeviceStatus.DeviceFirmwareVersion + Environment.NewLine;
        r += "DeviceManufacturer: " + DeviceStatus.DeviceManufacturer + Environment.NewLine;
        r += "OS Version: " + Environment.OSVersion + Environment.NewLine;
        r += "User ID: " + settings[KeyString.USER_ID] + Environment.NewLine;
        var phone = PhoneNameResolver.Resolve(DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);
        r += "Phone model(userfriendly form):" +phone.FullCanonicalName ;
        return r;
    }
like image 39
Parth Sehgal Avatar answered Oct 20 '22 01:10

Parth Sehgal