Tablets don't have this, for example
Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1
unlike phones
Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
This can be used to detect Android tablet devices
is_androidmobile = request.user_agent =~ /android/i && request.user_agent =~ /mobile/i
in context
def is_mobile?
is_iosmobile = request.user_agent =~ /iphone|ipod/i
is_androidmobile = request.user_agent =~ /android/i && request.user_agent =~ /mobile/i
return is_iosmobile || is_androidmobile
end
more on that here,
android-browser-user-agent-issues
No comments:
Post a Comment