Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Android Mobile or Tablet user_agents #1236

Closed
hafizbistar opened this Issue · 10 comments

4 participants

@hafizbistar

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"

http://googlewebmastercentral.blogspot.com/2011/03/mo-better-to-also-detect-mobile-user.html

@hafizbistar

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')))
        continue;

    $this->is_mobile = TRUE;
    return TRUE;
}
@narfbg
Owner

Sorry, but a tablet IS a mobile device.

@narfbg narfbg closed this
@hafizbistar

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. ;)

@narfbg
Owner

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

@hafizbistar

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

@dchill42

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

@narfbg
Owner

Has been done already.

@Dinesh-Ramakrishnan

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?

@hafizbistar

maybe useful to you:
https://developers.google.com/chrome/mobile/docs/user-agent

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.