Mobile Phone/PDA Web Browser Screen Size Detection
Posted 2008-07-29 in Mobile Web by Johann.
Photo by mawel. Some rights reserved.
Screen size detection of mobile phones and PDAs seems to be a minefield – I had planned to spend minutes on this…
Screen Size in the User-Agent
IEMobile and Opera Mobile on Windows Mobile and the Palm Blazer browser send the screen size in the user agent string using a WIDTHxHEIGHT
form. Examples include Dopod818Pro/Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320; Dopod818 Pro)
or Xda_trion; 240x320 (compatible; MSIE 6.0; Windows CE; IEMobile 6.12)
. A simple regular expression like ([0-9]{3})x([0-9]{3})
should work here.
Opera Mini
Opera Mini sends a X-OPERAMINI-PHONE-UA
header with the request that contains a handset-specific user agent string whose value ends with …PPC; 240x320
on my PDA.
IEMobile
IEMobile additionally sends a UA-PIXELS: 320x240
header with its requests.
X-OS-PREFS
Featured in older Opera browsers on Symbian. Looks like X-OS-Prefs: fw:176; fh:208; …
.
PROFILE
, X-WAP-PROFILE
, X-WAP-REMOVEDPROFILE
, OPT
WAP-era headers that point to a UAProf profile of the mobile device. This URL needs to be loaded and parsed for the prf:ScreenSize
element. Seems to be mostly used in Nokia mobile browsers.
UA-PIXELS
, X-UP-DEVCAP-SCREENPIXELS
, X-JPHONE-DISPLAY
These seem to be present in certain (unmentioned) mobile phones.
Other X-…
Headers
There are even more X-…
headers.
Given this complexity, does it make sense to invest in a abstraction library like WURFL? I see less of the “old” mobile browsers every day and WURFL is never complete anyway.
Mobile browser statistics: WebKit on the rise, Opera losing share
Posted 2007-12-09 in Mobile Web by Johann.
Two months ago, I presented mobile browser statistics for my websites. The clear winner at that time was NetFront. Let’s do this again.
Mobile browser list
The top 15 mobile browsers, taken from the last four weeks of log files.
- 1. Mozilla/4.0 (PSP (PlayStation Portable); 2.00)
- 4004 requests. NetFront-based.
- 2. Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A109a Safari/419.3
- 338 requests.
- 3. Opera/9.50 (J2ME/MIDP; Opera Mini/4.0.9800/209; U; en)
- 270 requests.
- 4. Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3
- 232 requests.
- 5. Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/11.0.026; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
- 231 requests.
- 6. Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE90-1/07.24.0.3; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
- 211 requests.
- 7. Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.6530/1724; en; U; ssr)
- 168 requests.
- 8. Opera/8.01 (J2ME/MIDP; Opera Mini/1.1.4948/hifi/tmobile/uk; SonyEricsson K510i; en; U; ssr)
- 167 requests
- 9. Opera/9.10 (Nintendo Wii; U; ; 1621; en)
- 134 requests
- 10. Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3
- 124 requests.
- 11. Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) BlackBerry8800/4.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/125
- 124 requests.
- 12. Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; Nokia N80/; 9712) Opera 8.65 [en]
- 123 requests.
- 13. Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE90-1/07.40.1.2; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
- 107 requests.
- 14. Nokia6300/2.0 (05.50) Profile/MIDP-2.0 Configuration/CLDC-1.1
- 96 requests.
- 15. HPiPAQhw6900/1.0/Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x240)
- 77 requests.
Raw numbers
Two months ago, I looked at 2242 requests.
- NetFront: 1066 requests, 48 %
- Opera Mini: 626 requests, 28 %
- Opera: 390 requests, 17 %
- AvantGo: 148 requests, 15 %
- WebKit: 12 requests, < 1 %
This time, I looked at 6282 requests.
- NetFront: 4004 requests, 63 %, up 15 %
- WebKit: 1243 requests, 19 %, up 18 %
- Opera Mini: 605 requests, 9 %, down 19 %
- Opera: 257 requests, 4 %, down 13 %
- Nokia: 96 requests, 1 %
- IEMobile/Pocket Internet Explorer: 77 requests, 1 %
The verdict
- Whereas I could see a slow shift from Internet Explorer to Mozilla-based browsers on
johannburkard.de
, the mobile web changes a lot faster and more deeply. - Microsoft’s mobile browsers are not popular at all, as are Gecko-based browsers. The mobile web looks like an anti-web from the browser perspective.
- The mobile web usage has almost tripled in two months on my sites.
Nokia E90 Communicator with Apple Safari as mobile web browser
Posted 2007-10-30 in Mobile Web by Johann.
As it turns out, the Nokia E90 Communicator has Safari as its mobile browser. Of course the E90 doesn’t look like the iPhone at all, but at least the same browser is there.
From what I remember, Nokia had used an own browser in the past. Even though I have no actual experience with Safari, I’m sure it is a better browser than the old Nokia and the other commonly encountered mobile browsers.
User Agent
The E90’s user agent string is Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE90-1/07.24.0.3; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
.
Log entries
The requests made by the Safari browser when loading my home page.
"GET / HTTP/1.1" … "GET /misc/style.js HTTP/1.1" … "GET /misc/handheld.css HTTP/1.1" … "GET /misc/screen.css HTTP/1.1" … "GET /blog/?flavor=simple&entries=1 HTTP/1.1" …
While the Safari-based browser supports JavaScript, it loads style sheets for the handheld
and screen
media type which reminds me of IEMobile and NetFront.
I might do another statistic about mobile browser usage in a few months and see what has changed in the mobile CSS and JavaScript world.
Simple Mobile Phone Detection
Posted 2009-02-12 in Mobile Web by Johann.
Looking for an easy and simple way to detect mobile browsers?
This regular expression should be able to detect most popular mobile phone browsers:
(IEMobile|Windows CE|NetFront|PlayStation|PLAYSTATION|like Mac OS X|MIDP|UP\.Browser|Symbian|Nintendo|Android)
Explanation
IEMobile
selects newer Windows Mobile browsers.Windows CE
selects older Windows Mobile browsers.NetFront
obviously selects NetFront browsers.PlayStation
andPLAYSTATION
select the PlayStation browsers.like Mac OS X
selects iPhone and iPod browsers.MIDP
selects most BlackBerry and Opera Mini browsers.UP.Browser
selects OpenWave-based browsers.Symbian
selects Opera browsers for Symbian.Nintendo
selects Opera browsers on Nintendo.
There are a few rare other mobile browsers not covered by this regular expression. Do you know of some that should be included? Please post a comment!
13 comments
Pages
Page 1 · Page 2 · Page 3 · Page 4 · Next Page »
Subscribe
RSS 2.0, Atom or subscribe by Email.
Top Posts
- DynaCloud - a dynamic JavaScript tag/keyword cloud with jQuery
- 6 fast jQuery Tips: More basic Snippets
- xslt.js version 3.2 released
- xslt.js version 3.0 released XML XSLT now with jQuery plugin
- Forum Scanners - prevent forum abuse
- Automate JavaScript compression with YUI Compressor and /packer/