In my ASP.NET MVC 3 web application, I redefine the view name in a custom view engine to present a different view optimized for non-tablet mobile devices.
All I want to accomplish for this redefinition is the exact value for Request.Browser.IsMobileDevice
and the deviceโs native screen width.
51degrees.mobi feels very difficult and confusing for this simple use case. Perhaps this is just my disappointment in trying to get through all the examples and documentation on the 51degrees website to get answers to what seem like simple questions for easy implementation.
Missing 51degrees, I get the values โโfor Request.Browser.IsMobileDevice
and Request.Browser.ScreenPixelsWidth
. I noticed that for desktop browsers the width is always 640, while Request.Browser.Capabilities["51Degrees.mobi"]
contains the value "Unknown" for ScreenPixelsWidth
. I think the Unknown value is more accurate given the nature of the server-side implementation.
My main question is: do I really need 51degrees for my simple requirements?
If I do not use 51degrees, are there some concrete examples of browsers that I cannot correctly determine IsMobileDevice and screen width? For example, the built-in .NET Request.Browser.IsMobile and ScreenPixelsWidth values โโwill be inaccurate or missing for the new iPad when it appears, or for the latest version of the Android browser? About 65% of mobile users get my site, many of the lame feature phones with browsers like UP.Browser, so getting mobile right is a bit important.
If I use 51degrees, do I always need to go to Request.Browser.Capabilities ["51Degrees.mobi"]? Or does 51degrees override / update the Request.Browser.IsMobileDevice value to synchronize with the browser rating? Obviously, this does not override Request.Browser.ScreenPixelsWidth.
I am open to the answers "you are doing it wrong, here is the best way" if they do not imply MVC 4 or include paid solutions such as WURFL.
source share