by using HttpSessionAccess.getCurrentRequest() you can access the current http request (HttpServletRequest-instance).
There you can access the header attributes of the http-request.
CaptainCasa adds the following attributes in addition to the normal ones:
"eclnt-width" => width of browser
"eclnt-height" => height of browser
Of course the width/height are not really strong indicators for the device type - this refers to the actual browser window, which could be "everything" on desktop systems.
But: the default attribute "User-Agent" should help you much more. It is not totally simple to get some device type out of it... but there are plenty of examples you can copy from StackOverflow! ;-)