Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android tablet not recog as mobile #39

Closed
seocam opened this issue Jun 10, 2014 · 4 comments
Closed

Android tablet not recog as mobile #39

seocam opened this issue Jun 10, 2014 · 4 comments

Comments

@seocam
Copy link

seocam commented Jun 10, 2014

django-mobile is not able to tell me I'm in a mobile device when accessing from an Android tablet. This problem occurs in every browser I've tested.

Follow the user agents:

Android browser: Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; GT-P7510 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30

Firefox for Android: Mozilla/5.0 (Android; Tablet; rv:29.0) Gecko/29.0 Firefox/29.0

Chrome for Android: Mozilla/5.0 (Linux; Android 4.0.4; GT-P7510 Build/IMM76D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36

@seocam
Copy link
Author

seocam commented Jun 10, 2014

Can we just check if android is present in the UA and set the flavour as mobile?

@Gandi24
Copy link

Gandi24 commented Oct 23, 2014

You can always override the middleware object like that:

class EnhancedMobileDetectionMiddleware(MobileDetectionMiddleware):
    user_agents_test_search = u"(?:%s)" % u'|'.join((
        'up.browser', 'up.link', 'mmp', 'symbian', 'smartphone', 'midp',
        'wap', 'phone', 'windows ce', 'pda', 'mobile', 'mini', 'palm',
        'netfront', 'opera mobi', 'android'
    ))

and include that in your settings.

But that's true, that android should be marked as mobile device.

@gregmuellegger
Copy link
Owner

We now have an example of a custom middleware: Please use this as the base to roll your own mobile detection middleware.

@gregmuellegger
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants