Saturday, June 30, 2012

New life of Mobile Device Detector

I've recently discovered amazing open-source module for detecting mobile device capabilities, called OpenDDR.
It seems to be the best alternative to the WURFL, and here's why:
  1. It is open-source and completely free for commercial deployments
  2. OpenDDR database contains huge amounts of information concerning phones, tablets, and even smart TVs
  3. Device database is regularly updated
So I've created a new version of Mobile Device Detector module based on OpenDDR. It is in beta for now, just like C# wrapper for OpenDDR, which can be found at GitHub - https://github.com/OpenDDRdotORG/OpenDDR-CSharp/.

OpenDDR Mobile Device Detector provides the same features as the WURFL-based version. plus - it is easier to install - no need to edit Web.config and Global.asax, just update paths to resources files (shipped with the module package, "resources" folder in /App_Data/) in /App_Data/oddr.properties.
And yet another bonus - the module now works with websites running .NET 2.0 Application Pool, target framework was changed to 3.5.

Download the module here and don't hesitate to leave your feedback (or bug reports) - you decide how the module will be developed in future!

15 comments:

  1. Thanks for the post, great you also check out the .NET version for C#

    Werner Keil
    Principal OpenDDR Evangelist

    ReplyDelete
  2. Thanks. Can you elaborate on how the paths should be configured in oddr.properties - should these be relative or absolute?

    e.g. will /App_Data/resources/BuilderDataSource.xml work?

    If so might have been better to code these as default values.

    ReplyDelete
  3. I'm not having much luck with this. OpenDdrWrapper.cs is missing when I get latest trunk from SVN...

    ReplyDelete
  4. Eventually got this working after reflecting the compiled DLL and recreating the missing file. Needs a bit of work, but looks promising.

    Thanks

    ReplyDelete
  5. Finally, got to the comments. If you still see any issues - let me know.

    ReplyDelete
  6. Thanks - if we have a mobile site on a subdomain e.g. m.mysite.com what is the easiest way to redirect to it based on device detection rules configured within Sitecore desktop via the rules engine?

    ReplyDelete
  7. The module itself just changes the layout based on the rules defined.
    But I think you can simply put some code to it (Mobile.aspx) to redirect to "m.mysite.com" if current request has different hostname.

    ReplyDelete
  8. Are you able to share the OpenDdrWrapper.cs file?

    ReplyDelete
  9. Sure, I'll check it later today. Meanwhile, you can see it's code in compliled DLL using Reflector / ilSpy, or similar.

    ReplyDelete
  10. I've uploaded missing file, you can find it here: http://trac.sitecore.net/MobileDeviceDetector/browser/Trunk/MobileDeviceDetector/OpenDdrWrapper.cs

    ReplyDelete
  11. Take care when using this. Many user agents are not handled correctly and will throw an exception. Our site ranking on Google got hammered as when Googlebot visited the site it was simply presented with a nice error message!

    ReplyDelete
  12. Please use 51degrees-based version instead, this one will never go out of beta.

    ReplyDelete
  13. Please use 51degrees-based version instead, this one will never go out of beta.

    ReplyDelete
  14. Hey Alex, any reason wqhy this will never leave beta? Is the license for WURFL too strict to use in a commercial application?

    ReplyDelete