browser_detection_php_ar
I have been using browser_detection_php_ar for a while and love it.
Times change and I have a new problem. Right now tablets (iPads, Androids) get lumped in with phones (iPhones, Androids). But the minimalistic html we send to smart phones is not appropriate for tablets. So, how about a new ua_type: tablet? As a start if the user agent string contains 'Android 3' then the client is a tablet. Sound good? Back to top |
|||||
Might be worth a look, but it won't be based on android 3 identification, google just released android 3 for some tablets early, that is, there is no guarantee that smart phones won't be running android 3 next year, or 6 months from now.
The other thing I'm not really fond of in terms of making a specific tablet id is that things like samsung galaxy come in different sizes, one has a 4 inch screen, which to me is a large smart phone, not a small tablet. Other things are obvious, like ipad, but the others aren't. For now I'd just add in your own handling server side: if mobile if ipad or if android os version >=3 then... do tablet stuff There's already a mobile os and a mobile os number, so: if mobile os is android and if mobile os number ~= 3.xxx then... I'll probably wait a bit to do any official tablet id, again, because what they call tablets is pretty hard to tell apart from some smart phones. Back to top |
|||||
All the things you say are true, which is why we need a good library to hold the best community ideas. Then instead of just me trying to work around the problems more can help.
For now I am check for iPad and Android version 3 which has not led to complaints yet. Would be great to have the target screen size but I have no idea how to get that on the first hit. Back to top |
|||||
You can't get target screen size on first hit, that's a javascript thing, ie, only after page load, then pass it in cookie or get string, but I'm sure you know that already.
I seem to remember some cheaper tablets shipped with android 2.x, so even that id isn't very reliable. My feeling is that a simple detection of ipad and galaxy is going to hit probably 98% or more of all realworld tablets, not sure, maybe there's a new brand that also is selling, I don't follow that area very closely. Back to top |
|||||
Hard numbers from the raw logs of a server of mine for yesterday:
Total hits: 2,856,703 ipad: 82,201 iphone: 69,207 android 2: 52,870 android 3: 2,120 galaxy: 0 Android 3 is 2.5% of ipad+android 3, so your 2% is not far off. Except 'galaxy' is just not there at all and no idea what percent of android 2 is tablet. For comparison, another server from yesterday: Total hits: 16,991,393 ipad: 562,934 iphone: 776,937 android 2: 484,488 android 3: 15,995 Since you can get 97% of the way there looking for ipad that looks like a good start to a new return variable. Back to top |
|||||
Also, android 4 was just announced, and it will support both small devices and tablets, which means that it looks like the android 3 id will be a safe way to test for tablet after all.
However, android 4 will not be a safe id since they have reintegrated android to be flexible enough to support various platforms again. Back to top |
|||||
By request, added return value to the main mobile data array of mobile tablet. This is array key 8, and will be either null or not null, so test for null, not true/false. Or just do:
:: Code :: if ( $a_browser_data['mobile_data'][8] ){
do tablet stuff } 5.3.18 has this in it. All I did was add another array return for mobile_data, key 8 This is the easiest way to handle it, and the least intrusive for existing methods people might be using. If you need this more fine grained, ie, if it's missing known tablets, then please provide the full tablet User Agent string that must contain a totally unique id method, like iPad or Android 3 that would only be found on a tablet. It's easy to update the detections to handle more tablet types, but since I don't follow this stuff very closely, you'll have to provide the data, which will be applied when it trickles in. By the way, nice stats, and good feedback. Back to top |
|||||
All times are GMT - 8 Hours
|