Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Android Mobile or Tablet user_agents #1236

hafizbistar opened this Issue · 10 comments

4 participants


not sure how to implement it, but it would be better if the user_agents could differentiates between android mobile and tablet.
note:as far as i know (with my very limited knowledge), tablet devices still uses media="screen" instead of media="handheld"


At the moment, i extend the User_agent.php library as MY_User_agent.php

added all the private functions, and slightly edit the _set_mobile()

if (FALSE !== (strpos(strtolower($this->agent), $key)))
    $this->mobile = $val;
    if($val == 'Android' && ! (strpos(strtolower($this->agent), 'Mobile')))

    $this->is_mobile = TRUE;
    return TRUE;

Sorry, but a tablet IS a mobile device.

@narfbg narfbg closed this

well.. from my point of view, we want to know the user agent mainly because we want to customize the CSS of certain devices.
Tablet devices does not read from "handheld" media type instead it reads from "screen". Some smart phones doesn't either (possibly due to the huge resolution it supports).

But regardless of the changes of this thread status, i don't think its no longer necessary.
Now the hot keyword is responsive design. ;)


If you can come up with a new (and reasonable) feature for that - that would be great, but is_mobile has other purposes.


Actually, I have no clue of what other purpose to detect the user_agent.
sorry, can't be much help.


This sounds like it should be a media_type() call. Can that be reliably determined from the user agent string?


Has been done already.


could you please provide me some info on how to differentiate between android tablet and android phone, do we have another function in user_agent library?


maybe useful to you:

take note that it is not a complete solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.