Skip to content

Instantly share code, notes, and snippets.

@ryanvalentin
Last active August 29, 2015 14:14
Show Gist options
  • Save ryanvalentin/67137c282ad52f85c92e to your computer and use it in GitHub Desktop.
Save ryanvalentin/67137c282ad52f85c92e to your computer and use it in GitHub Desktop.
Lumia device name dictionary
private static readonly Dictionary<string, string> _deviceMap = new Dictionary<string, string>
{
{ "ACCORD", "HTC 8X" },
{ "H883G", "Huawei W1" },
{ "MOBILE", "Cherry Mobile Alpha Luxe" },
{ "P4301", "Lumia 920" },
{ "P5122", "Lumia 620" },
{ "P5174", "Lumia 820" },
{ "P5217", "Lumia 1020" },
{ "P5238", "Unknown Lumia (P5238)"},
{ "P5219", "Lumia 822" },
{ "P5250", "Lumia 928" },
{ "P6010", "Unknown Lumia (P6010)" },
{ "P6012", "Lumia 720" },
{ "P6017", "Lumia 810" },
{ "P6023", "Lumia 925" },
{ "P6036", "Lumia 520" },
{ "P6037", "Lumia 521" },
{ "P6039", "Lumia Icon" },
{ "P6081", "Lumia 1520" },
{ "P6083", "Lumia 625" },
{ "P6112", "Lumia 630" },
{ "P6122", "Lumia 830" },
{ "P6134", "Lumia 530" },
{ "P6136", "Unknown Lumia (P6136)" },
{ "P6137", "Lumia 525" },
{ "P6145", "Lumia 1320" },
{ "P6164", "Lumia 735" },
{ "P6180", "Lumia 930" },
{ "P6209", "Unknown Lumia (P6209)" },
{ "P6214", "Lumia 535" },
{ "PSP8500DUO", "Prestigo 8500 DUO" },
{ "RIO", "HTC 8S" },
{ "SURF/CDP", "Unknown Other (SURF/CDP)" },
{ "TIARA", "HTC 8XT" },
{ "U8835", "Huawei Ascend W1" },
{ "W121", "Micromax Canvas Win W121" },
{ "W2", "Huawei W2" },
{ "W8", "HTC One (M8)" }
};
public static string GetDeviceName(string codeName)
{
string variantNormalized = (codeName ?? "").Split('_')[0];
string deviceName = "";
if (_deviceMap.TryGetValue(variantNormalized, out deviceName))
return deviceName;
else
return String.Format("Unknown ({0})", variantNormalized);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment