<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Thoughts &#187; measure</title>
	<atom:link href="http://martijnpannevis.nl/blog/tag/measure/feed/" rel="self" type="application/rss+xml" />
	<link>http://martijnpannevis.nl/blog</link>
	<description>It compiles; Let's ship it!</description>
	<lastBuildDate>Mon, 13 Dec 2010 13:18:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A quick hack to measure iPhone OS distribution</title>
		<link>http://martijnpannevis.nl/blog/2009/09/12/a-quick-hack-to-measure-iphone-os-distribution/</link>
		<comments>http://martijnpannevis.nl/blog/2009/09/12/a-quick-hack-to-measure-iphone-os-distribution/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 11:18:03 +0000</pubDate>
		<dc:creator>Martijn</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[distribution]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[measure]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://martijnpannevis.nl/blog/?p=274</guid>
		<description><![CDATA[I haven&#8217;t posted here in a while, since I have been so busy building new stuff. Some updates are expected soon (iPhone Layar anyone?)
Since most of the projects I&#8217;m working on involve iPhones in some way, I was interested in OS distribution on the iPhone platform: Is it still necessary to target OS 2.xx, or has [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t posted here in a while, since I have been so busy building new stuff. Some updates are expected soon (iPhone Layar anyone?)<br />
Since most of the projects I&#8217;m working on involve iPhones in some way, I was interested in OS distribution on the iPhone platform: Is it still necessary to target OS 2.xx, or has 3.xx have enough uptake?</p>
<p>Since the iPhone sends it&#8217;s OS version in every web request it does, I decided to have a look at my own logfiles (in the hope that bigger apps will follow <img src='http://martijnpannevis.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>I do realise this isn&#8217;t a scientific valid result: It&#8217;s just the distribution of one, quite recent, app. However, it does say something. So, without further ado, I present the results:</p>
<table border="0" width="500">
<tbody>
<tr>
<td>OS:</td>
<td>3_0_1</td>
<td>68%</td>
</tr>
<tr>
<td>OS:</td>
<td>3_0</td>
<td>20%</td>
</tr>
<tr>
<td>OS:</td>
<td>2_2</td>
<td>1%</td>
</tr>
<tr>
<td>OS:</td>
<td>2_2_1</td>
<td>3%</td>
</tr>
<tr>
<td>OS:</td>
<td>3_1</td>
<td>9%</td>
</tr>
</tbody>
</table>
<p> </p>
<p>From this small sample, 4% didn&#8217;t already run 3.xx (it might help that this is an iPhone only app: iPod Touches apparently are updated less).</p>
<p>Since this is only taken from a small sample, I hope bigger apps will release their stats. Here is the small PHP code I used:</p>
<pre><code><span style="color: #000000;"><span style="color: #0000bb;">&lt;?
define</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"LOGFILE"</span><span style="color: #007700;">,</span><span style="color: #dd0000;">"/home/panman/logs/prod.panman.nl_access_log"</span><span style="color: #007700;">);
</span><span style="color: #0000bb;">$lines</span><span style="color: #007700;">=</span><span style="color: #0000bb;">file</span><span style="color: #007700;">(</span><span style="color: #0000bb;">LOGFILE</span><span style="color: #007700;">);
foreach (</span><span style="color: #0000bb;">$lines </span><span style="color: #007700;">as </span><span style="color: #0000bb;">$line</span><span style="color: #007700;">){
if (!</span><span style="color: #0000bb;">eregi</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"stufidates"</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$line</span><span style="color: #007700;">)) {continue;}
</span><span style="color: #ff8000;">//if ($i==0) {echo $line;}
    </span><span style="color: #0000bb;">$parts</span><span style="color: #007700;">=</span><span style="color: #0000bb;">explode</span><span style="color: #007700;">(</span><span style="color: #dd0000;">" "</span><span style="color: #007700;">,</span><span style="color: #0000bb;">$line</span><span style="color: #007700;">);
    if (</span><span style="color: #0000bb;">$parts</span><span style="color: #007700;">[</span><span style="color: #0000bb;">12</span><span style="color: #007700;">]!=</span><span style="color: #dd0000;">"(iPhone;"</span><span style="color: #007700;">){
    </span><span style="color: #0000bb;">$detects</span><span style="color: #007700;">[</span><span style="color: #dd0000;">"noip"</span><span style="color: #007700;">]++;
    } else {
        </span><span style="color: #0000bb;">$os</span><span style="color: #007700;">=</span><span style="color: #0000bb;">$parts</span><span style="color: #007700;">[</span><span style="color: #dd0000;">"17"</span><span style="color: #007700;">];
        </span><span style="color: #0000bb;">$detects</span><span style="color: #007700;">[</span><span style="color: #0000bb;">$os</span><span style="color: #007700;">]++;
    }
    </span><span style="color: #0000bb;">$i</span><span style="color: #007700;">++;
}

echo </span><span style="color: #dd0000;">"&lt;table width=500&gt;"</span><span style="color: #007700;">;
foreach (</span><span style="color: #0000bb;">$detects </span><span style="color: #007700;">as </span><span style="color: #0000bb;">$key</span><span style="color: #007700;">=&gt;</span><span style="color: #0000bb;">$hits</span><span style="color: #007700;">){
echo </span><span style="color: #dd0000;">"&lt;tr&gt;&lt;td&gt;OS:&lt;/td&gt;&lt;td&gt;"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">$key</span><span style="color: #007700;">.</span><span style="color: #dd0000;">"&lt;/td&gt;&lt;td&gt;"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">number_format</span><span style="color: #007700;">((</span><span style="color: #0000bb;">$hits</span><span style="color: #007700;">/</span><span style="color: #0000bb;">$i</span><span style="color: #007700;">)*</span><span style="color: #0000bb;">100</span><span style="color: #007700;">).</span><span style="color: #dd0000;">"%&lt;/td&gt;&lt;/tr&gt;"</span><span style="color: #007700;">;
}
echo </span><span style="color: #dd0000;">"&lt;/table&gt;"</span><span style="color: #007700;">;
echo </span><span style="color: #dd0000;">"Total:"</span><span style="color: #007700;">.</span><span style="color: #0000bb;">$i</span><span style="color: #007700;">;
</span><span style="color: #0000bb;">?&gt;</span></span></code></pre>
<p><span><span style="color: #000000;">If you have an iphone app that does requests to your webserver, please run this code (or something similar, it&#8217;s just a first version) on your logs, and let me know the results.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://martijnpannevis.nl/blog/2009/09/12/a-quick-hack-to-measure-iphone-os-distribution/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

