What's Covered
This tutorial illustrates how to access match metrics. The following is covered:
- How to retrieve a full list of all devices and the properties for each.
- Writing the data to a csv file.
Code and Explanation
All profiles example of using 51Degrees device detection.
The example shows how to:
string fileName = args[0];
DataSet dataSet = StreamFactory.Create(fileName, false);
StreamWriter fout = new StreamWriter(outputFile);
fout.Write("Id"); foreach (Property property in hardwareProperties) { fout.Write("," + property.Name); } fout.Write("\n");
Profile[] hardwareProfiles = dataSet.Hardware.Profiles;
foreach (Value value in profile.Values) { if (value.Property == property) { // Append this value to the string. values += value.ToString(); } }This tutorial assumes you are building this from within the 51Degrees Visual Studio solution. Running the executable produced inside Visual Studio will ensure all the command line arguments are preset correctly. If you are running outside of Visual Studio, make sure to add the path to a 51Degrees data file as an argument.
Summary
All Profiles is a code to convert all of the profiles held within our database into a CSV file to be used for other services, such as analytic use.
All Profiles consists of every device within our database and the values of all properties associated with that device.
The Lite data file contains 446,634 device combinations, whilst Premium and Enterprise contain 940,018 and 1,407,838 device combinations respectively. A larger set of device combinations leads to the 'exact' detection method being used more frequently and the results being more reliable.