Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Simon Newsgroups: comp.lang.php Subject: Re: The prefered way to handle mobile apps? Date: Fri, 29 Jul 2011 08:33:59 +0200 Lines: 45 Message-ID: <99f2ipFgb9U1@mid.individual.net> References: <99cin5FioiU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net WSwf/Ufc1LaEiHHToGQo8A0/tzCFUEjZ7Cx0OonHIMlVt8TGg+ Cancel-Lock: sha1:wYFtk9yvP+92knolZmwBHnef3A4= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:2677 On 2011/07/28 02:39 PM, Peter H. Coffin wrote: > On Thu, 28 Jul 2011 09:51:00 +0200, Simon wrote: >> Hi, >> >> I would like to display my front page diferently for mobile users, (as >> well as a few other pages). >> >> I see on the web that there are various scripts to detect mobile apps, >> (from the user agent). >> >> But from experience those quickly get out of date or are simply buggy >> and return some false positive. >> >> So my questions are simple, (I think). >> >> Is there a sure fire way to dynamically detect mobile apps? > > No. The user-agent value is what you've got to work with. Mostly, Real > Developers handle this by spending no small amount of time reading > documentation, experimenting, and testing with new devices and new OS > releases for those devices. People without a development budget adequate > for this kind of testing have to get by via reading the same doco, and > following discussions between those people that do that kind of testing > comparing notes. And, if one doesn't feel like sitting on one's hands > during those discussions, fixing the bugs in the detection routines > using the information others collect is a perfectly valid contribution. > Thanks for that. Truth be told, my 2 main concerns are 1) false positves. For example, Mobile_Detect (http://code.google.com/p/php-mobile-detect/), a very brief look at the bug list shows a fair amount of false positves. 2) The time spent at every page load to look if this is a mobile or not. In the end, I might settle for $_SERVER['HTTP_X_WAP_PROFILE'] and/or $_SERVER['HTTP_ACCEPT'] (wap) Thanks all Simon