Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Adaptive Design

We actually like to use the function of elefant to query the device being used so we can deliver a tailored experience versus using responsive design. My question is there a way to edit the devices detected string? We are running into an issue on the Galaxy tablets side where they are being detected as mobile phones and delivering a phone optimized version of the sites when using the "mobile" tag to query.


  • The detect() function is a bit simplistic and Android will return true for both detect('mobile') and detect('tablet') currently. I'm definitely open to improvements, but I haven't done much research on user agent strings for Android devices myself.

    Here's the full source code for the function, for reference:

    According to this page, detecting both the 'android' and 'mobile' in the user agent is supposed to reliably differentiate between Android mobile vs Android tablets. That sounds like a good start towards improving it.

Sign In or Register to comment.