Author Topic: Mobile Users  (Read 380 times)

Offline chesney-93

  • Level 7
  • *
  • Posts: 30
  • Reputation: +0/-0
    • View Profile
Mobile Users
« on: June 03, 2011, 03:16:07 AM »
Whats the best way to detect if users are using a mobile device?

Offline andrewjbaker

  • Level 17
  • *
  • Posts: 154
  • Reputation: +2/-0
    • View Profile
    • Fleeting Fantasy
Re: Mobile Users
« Reply #1 on: June 03, 2011, 06:03:51 AM »
You shouldn't really check for platform. Check for capabilities instead... Modernizr. ;)
Currently working on an HTML5 canvas 2.5D landscape renderer and a PBBG that uses it (http://fleetingfantasy.com/). The development blog's at http://fleetingfantasy.wordpress.com/.
What are BBGameZone members working on? See the game list.
irc.freenode.net, #bbg

Offline Freyr

  • Level 7
  • *
  • Posts: 30
  • Reputation: +1/-0
    • View Profile
Re: Mobile Users
« Reply #2 on: June 03, 2011, 03:01:12 PM »
User-agents, just like most other things, can bee spoofed. So that means that there is no 100% chance of detecting a browser.
Now that the security aspect of it is out of the way...

PHP has an extension called "browsercap", that does mostly the same as "Modernizr", and without the haste of installing third-party client libraries.
I've used it before, and it's quite solid, except for obvious flaws.

Link: http://php.net/manual/en/function.get-browser.php
// this is a comment

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal