While user agent can be spoofed (and pretty easily with most browsers), the reality is it's not a problem you need to worry about. You do generally want to try and avoid user agent when possible, but if your trying to detect the device purely on the server, there really isn't another option. Any kind of client side detection (such as screen width) will require and least a two trips to the server--once to serve up the client-side code that detects the device, then you hit the server again to change the layout.
On Friday, September 27, 2013, John M Bliss wrote: > > > I would suggest basing your redirect on screen width rather than user > agent strings. > > This. This is why I ask questions like this one of this list. Answer so > simple and yet so genius. Thank you! > > > On Fri, Sep 27, 2013 at 5:50 PM, Brian Cain <bcc9...@gmail.com> wrote: > > > > > I would suggest basing your redirect on screen width rather than user > > agent strings. Also the dev tools in Chrome has a neat little feature to > > allow you to specify a different user agent as well as screen size for > > testing on the desktop. > > > > Sent from my iPhone > > > > > On Sep 27, 2013, at 4:13 PM, "Dan G. Switzer, II" < > > dswit...@pengoworks.com> wrote: > > > > > > > > > John, > > > > > > I've looked into the following recently: > > > > > > - http://detectmobilebrowsers.com/ - In my testing, the code they > give > > > you works surprisingly well. It does not report tablets as mobile, > > which is > > > the behavior I was looking for, but not be want you want. They > > basically > > > give you some CFML and then you tweak the conditional statement for > > your > > > needs. > > > - WURFL (Java API) - Pretty easily to get up and running w/CF. The > > > licensing is a bit weird, but you get very robust information back. > > Due to > > > the fact you must load a 16MB XML config file, the initialization > time > > is > > > really slow, so you definitely want to cache your implementation so > the > > > init only happens once. > > > - 51Degrees (Java API) - They offer a free version, but it lumps > > tablets > > > in as a mobile device. You can upgrade to a paid version to > > differentiate > > > tablets and phones. I like the API better than WURFL and > > initialization is > > > much faster, but analyzing data is much slower. WURFL is darn quick. > > > > > > I've still be trying to find a good database of User Agents that breaks > > the > > > strings down into "desktop", "tablet" and "phone" so that I could run > > unit > > > tests of the various implementations, but the DetectMobileBrowsers.com > > code > > > has been as accurate as WURFL in my limited tests of a few dozen user > > > agents. > > > > > > -Dan > > > > > > > > > > > > > > >> On Fri, Sep 27, 2013 at 2:26 PM, John M Bliss <bliss.j...@gmail.com> > > wrote: > > >> > > >> > > >> Agreed. Unfortunately, client has only approved hours to develop > mobile > > >> version...not hours to redevelop / redesign existing site so that it's > > >> responsive. > > >> > > >> Basically, when mobile is detected, I'll be rendering a > mobile-optimized > > >> "skin" around existing CFML CMS-driven "center trough" content. > > >> > > >> > > >>> On Fri, Sep 27, 2013 at 2:21 PM, Che Vilnonis <ch...@asitv.com> > wrote: > > >>> > > >>> > > >>> You could also look to "Responsive Web Design" in lieu of creating a > > >>> separate site. > > >>> > > >>> ~Ché > > >>> > > >>> -----Original Message----- > > >>> From: Ron Gowen [mailto:rsgo...@gmail.com] > > >>> Sent: Friday, September 27, 2013 2:21 PM > > >>> To: cf-talk > > >>> Subject: Re: Mobile > > >>> > > >>> > > >>> i use this: (not sure im cool though) > > >>> > > >>> https://github.com/sebarmeli/JS-Redirection-Mobile-Site > > >>> > > >>> > > >>> On Fri, Sep 27, 2013 at 11:16 AM, John M Bliss <bliss.j...@gmail.com > > > > >>> wrote: > > >>> > > >>>> > > >>>> Hi! I'm tasked with developing mobile browser-optimized version of > > >>>> existing site. What're the cool kids currently using for mobile > > Archive: > http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356863 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm > -- Dan G. Switzer, II dswit...@pengoworks.com http://blog.pengoworks.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356864 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm