Ruby Mobile Browser Detector (port of JMBD)
May 24th, 2008
I have successfully ported Java Mobile Browser Detector to ruby. I am sure there are other existing utilities to achieve this but I found this to more simpler to understand and use. It works well with my mobile site Fundu.mobi developed on rails. I though it would be useful for someone so here is the code rmbd.zip.
Here is how you can use it in any controller
class SampleController < ApplicationController
def index
device_config = DeviceConfigDetector.detect_capabilities_for_request(request);
logger.debug("device config = #{device_config.inspect}")
end
end
UPDATE: This is now hosted as ruby gem available at http://github.com/kiranmeduri/rmbd/tree/master