Isn’t it great if you can detect the capabilities of incoming mobile website visitors, including capabilities such as whether the device is being used to access the site is a mobile/smartphone/tablet, device/model, resolution etc. With the WURFL Cloud, you can do them all. The WURFL Cloud Client is your interface to the WURFL Device Description Repository (The Device Description Repository (DDR) is a concept proposed by the Mobile Web Initiative Device Description Working Group (DDWG) of the World Wide Web Consortium.) which contains detailed definitions for thousands of mobile devices.
WURFL Cloud Client can be used with C#.NET, Java, PHP, Python, Ruby, Node.js and Perl. In this post let’s see how we can use WURFL Cloud Client with C# using an ASP.NET Web application.
First what you have to do is create an account with WURFL Cloud. There are different plans to select from such as Free, Basic, Standard and Premium. Higher the plan is, the more capabilities you get.
Here I have created a free account and after completing the necessary steps, I am in my account now. Here in the capabilities tab, you can see the capabilities which is enabled to your account.
Since it is the Free plan, I have been given with limited capabilities.
Now let’s start with creating a ASP.NET Web Application. I am going to create an empty Web Application and I will be adding a Web Form to the page. Now I need to add reference to “ScientiaMobile.WurflCloud.dll” which you can download once you have created your account.
Now Inside the page, I will have several labels to show all the capabilities for the free plan which are model_name, brand_name, is_smartphone, is_tablet and is_wireless_device.
I have the following class which will contain some properties of devices.Then I have another class which contains a method to get device information. Here I will need to mention the ApiKey, you can find it in your account.
Now in the page load event, I am calling the above method and showing the results in the labels.Now after publishing the site, I am accessing the site from my PC.