<?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>Open Source Web Thoughts &#187; mobile</title>
	<atom:link href="http://blog.dewaldbotha.co.za/category/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dewaldbotha.co.za</link>
	<description></description>
	<lastBuildDate>Fri, 25 Nov 2011 09:17:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>the down-low on mobile device detection</title>
		<link>http://blog.dewaldbotha.co.za/2009/02/19/the-down-low-on-mobile-device-detection/</link>
		<comments>http://blog.dewaldbotha.co.za/2009/02/19/the-down-low-on-mobile-device-detection/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 14:28:09 +0000</pubDate>
		<dc:creator>dewaldbotha</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[devicealtas]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[mobile device detection]]></category>
		<category><![CDATA[php alternative cache]]></category>
		<category><![CDATA[php apc]]></category>
		<category><![CDATA[wurfl]]></category>

		<guid isPermaLink="false">http://blog.dewaldbotha.co.za/2009-02-19/the-down-low-on-mobile-device-detection/</guid>
		<description><![CDATA[so &#8211; you say you want to detect which mobile devices hit your site? &#8211; in the past, this has been a bit of an issue, but lately &#8211; with really nice projects available out there such as WURFL or DeviceAtlas, you are able to concentrate harder on other issues, instead of having to write <a href="http://blog.dewaldbotha.co.za/2009/02/19/the-down-low-on-mobile-device-detection/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>so &#8211; you say you want to detect which mobile devices hit your site? &#8211; in the past, this has been a bit of an issue, but lately &#8211; with really nice projects available out there such as <a href="http://wurfl.sourceforge.net/" title="WURFL" target="_blank">WURFL</a> or <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a>, you are able to concentrate harder on other issues, instead of having to write a complete library of your own.</p>
<p>so for this, i&#8217;ve decided on <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a>.  just head on over to <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a> and open a developers account &#8211; you will get a one year developer&#8217;s license to play around to see how cool it is.</p>
<p>after registering &#8211; click on the <a href="http://deviceatlas.com/downloads" title="download DeviceAtlas" target="_blank">downloads</a> link &#8211; then go to the php example and download the source files.  after de-tar-and-un-zipping the file, just extract the contents.  at the moment all we are really interested in, is the <em><strong>Mobi/Mtld/DA </strong></em>directory and its contents &#8211; also create a <em><strong>json</strong></em> directory and drop the <em><strong>Sample.jso</strong></em>n file inside.</p>
<p>dump everything into a web directory somewhere. <img src='http://blog.dewaldbotha.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><span id="more-16"></span>create a <em><strong>deviceatlas.php</strong></em> file in the working directory root and put the following inside.</p>
<pre lang="php">//includes the DeviceAtlas API

include 'Mobi/Mtld/DA/Api.php';//fetch the previously populated apc cache instance into a variable

$tree = apc_fetch('tree');

//Get the properties from a variable containing a JSON tree loaded from cache

$properties = Mobi_Mtld_DA_Api::getProperties($tree, $_SERVER['HTTP_USER_AGENT']);

//Output the phone properties for your viewing pleasure

print_r($properties);</pre>
<p>&#8216;hhmmm, that&#8217;s it?&#8217;, you might ask, and if you were clever you would have noticed something strange in the code above.</p>
<p>yip, that is pretty much it &#8211; but you also need caching.  the <em><strong>apc_fetch(&#8216;tree&#8217;)</strong></em> command in the code above actually fetches the json file already dumped into a &#8216;tree&#8217; cache instance in <a href="http://www.php.net/manual/en/intro.apc.php" title="PHP APC Cache" target="_blank">PHP APC</a> (Alternative PHP Cache).</p>
<p>why <a href="http://www.php.net/manual/en/intro.apc.php" title="PHP APC Cache" target="_blank">PHP APC</a>, you may also ask.  well, besides using the overstated <a href="http://www.danga.com/memcached/" title="Memcached" target="_blank">memcached</a> (<a href="http://www.phpbuilder.com/board/archive/index.php/t-10346692.html" title="Memcache vs APC" target="_blank">you might want to read this</a>), there are some methods to the madness.  with <a href="http://www.php.net/manual/en/intro.apc.php" title="PHP APC Cache" target="_blank">PHP APC</a>, the cache is shared on a server.  it might not be accessible from other servers, but this is not really a con in my mind.</p>
<p>if you wish to scale your application later one and add another server, there is going to be some issues, you might say &#8211; but there will also be issues if you have millions of users hit one central instance of <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a>.  so, having one instance of <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a> per server might not be too much of an issue.  also when it comes to updating the json file, you might want to consider the <a href="http://en.wikipedia.org/wiki/Single_point_of_failure" title="Single Point of Failure" target="_blank">single point of failure</a> issue of just having one server.</p>
<p>so have a couple of servers, and just write some scripts to update the single instances of <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a>, rather than updating one, already busy server which still needs a cache update.</p>
<p>but, back to business.</p>
<p>first you have to install <a href="http://www.php.net/manual/en/intro.apc.php" title="PHP APC Cache" target="_blank">PHP APC</a>.  i found <a href="http://www.howtoforge.com/apc-php5-apache2-debian-etch" title="Apc Installation guide" target="_blank">this handy guide</a> on the net, which helped me install it on my <a href="http://en.wikipedia.org/wiki/Debian" title="Debian" target="_blank">debian</a> system and integrate it with <a href="http://en.wikipedia.org/wiki/Apache_server" title="Apache" target="_blank">apache</a> and <a href="http://en.wikipedia.org/wiki/Php5" title="PHP 5" target="_blank">php5</a> &#8211; there is also a guide at the bottom for <a href="http://en.wikipedia.org/wiki/Red_hat" title="Red Hat" target="_blank">fedora</a> based machines, so don&#8217;t fret my <a href="http://en.wikipedia.org/wiki/Linux" title="Linux" target="_blank">linux</a> loving friends <img src='http://blog.dewaldbotha.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>you can create a php script to run the following &#8211; which should cache your <a href="http://deviceatlas.com/" title="DeviceAtlas" target="_blank">DeviceAtlas</a> tree into <a href="http://www.php.net/manual/en/intro.apc.php" title="PHP APC Cache" target="_blank">PHP APC</a>.</p>
<pre lang="php">//ads the sample json data from DeviceAtlas

apc_add('tree', Mobi_Mtld_DA_Api::getTreeFromFile("json/Sample.json"));</pre>
<p>from the first code example, the output might look something like this (depending on your phone)</p>
<p>Array<br />
(<br />
[wmv] =&gt; 0<br />
[vendor] =&gt; Nokia<br />
[mobileDevice] =&gt; 1<br />
[memoryLimitMarkup] =&gt; 357000<br />
[memoryLimitDownload] =&gt; 61440<br />
[midiMonophonic] =&gt; 1<br />
[midiPolyphonic] =&gt; 1<br />
[mpeg4] =&gt; 1<br />
[3gpp] =&gt; 1<br />
[drmOmaForwardLock] =&gt; 1<br />
[drmOmaCombinedDelivery] =&gt; 1<br />
[drmOmaSeparateDelivery] =&gt; 1<br />
[markup.xhtmlMp10] =&gt; 1<br />
[markup.xhtmlBasic10] =&gt; 1<br />
[image.Jpg] =&gt; 1<br />
[image.Png] =&gt; 1<br />
[amr] =&gt; 1<br />
[mp3] =&gt; 1<br />
[aac] =&gt; 1<br />
[h263Type0InVideo] =&gt; 1<br />
[gprs] =&gt; 1<br />
[edge] =&gt; 1<br />
[image.Gif87] =&gt; 1<br />
[uriSchemeTel] =&gt; 0<br />
[qcelp] =&gt; 0<br />
[hsdpa] =&gt; 0<br />
[amrInVideo] =&gt; 1<br />
[3gpp2] =&gt; 0<br />
[displayColorDepth] =&gt; 18<br />
[model] =&gt; N70<br />
[https] =&gt; 1<br />
[image.Gif89a] =&gt; 0<br />
[umts] =&gt; 0<br />
[displayWidth] =&gt; 176<br />
[displayHeight] =&gt; 208<br />
[markup.xhtmlMp11] =&gt; 0<br />
[markup.xhtmlMp12] =&gt; 0<br />
[csd] =&gt; 0<br />
[hscsd] =&gt; 0<br />
[id] =&gt; 204255<br />
[_matched] =&gt; NokiaN70<br />
[_unmatched] =&gt; -1/5.0609.2.0.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Link/6.3.1.13.0<br />
)</p>
<p><a href="http://deviceatlas.com/properties" title="DeviceAtlas properties" target="_blank">you can view the attribute explanations here </a></p>
<p>now you can use the phone&#8217;s specific properties to your advantage.  you also might want to look at the <a href="https://addons.mozilla.org/en-US/firefox/addon/59" title="User agent switcher" target="_blank">user agent switcher add-on</a> for firefox for testing purposes.</p>
<p>that&#8217;s it.  now every once in a while you can just update the json file, delete the current cache (<a href="http://www.php.net/manual/en/function.apc-delete.php" title="APC Delete Cache" target="_blank">http://www.php.net/manual/en/function.apc-delete.php</a>) and bob&#8217;s your device detecting, apc caching uncle.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dewaldbotha.co.za/2009/02/19/the-down-low-on-mobile-device-detection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>centering mobile web</title>
		<link>http://blog.dewaldbotha.co.za/2009/01/26/centering-mobile-web/</link>
		<comments>http://blog.dewaldbotha.co.za/2009/01/26/centering-mobile-web/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 14:17:58 +0000</pubDate>
		<dc:creator>dewaldbotha</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[mobile standards]]></category>
		<category><![CDATA[prototyping]]></category>
		<category><![CDATA[wurfl]]></category>
		<category><![CDATA[xhtml-mp]]></category>

		<guid isPermaLink="false">http://blog.dewaldbotha.co.za/2009-01-26/centering-mobile-web/</guid>
		<description><![CDATA[with all the focus being on the mobile web these days, one must have a basic understanding of how the pieces fit together before even writing a line of code. there is a great online community which supports mobile development called mobiforge which could be utilised to answer all of your mobile related questions. but <a href="http://blog.dewaldbotha.co.za/2009/01/26/centering-mobile-web/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>with all the focus being on the mobile web these days, one must have a basic understanding of how the pieces fit together before even writing a line of code.</p>
<p>there is a great online community which supports mobile development called <a href="http://mobiforge.com/" title="Mobiforge" target="_blank">mobiforge</a> which could be utilised to answer all of your mobile related questions.</p>
<p>but as a start i will point out some important steps/considerations to take/make:</p>
<p><span id="more-12"></span></p>
<h4>user-centered design</h4>
<p>before you start on any work, you have to realise that by doing a mobile site, the most important part of your equation is the user and his phone.  it is easy to develop/design a site which looks absolutely amazing in a pc browser, but fails to even load within a phone browser.</p>
<p>you have to make sacrifices in design/layout to suite the user of the site and understand the limitations your user might face with his specific mobile device.  people accessing a site with a lower end phone usually wants quick textual feedback about a certain subject, rather than big glossy images that fill your screen.  once you understand what the user need &#8211; and design according to those needs, then you will be ready to continue.</p>
<h4>keep your site simple</h4>
<p>it is easy in a web browser to go back in your history and traverse navigation, but on a mobile it is a bit different.  so why confuse the mobile user with 50 levels of navigation, where a simple three leveled hierarchy navigational solution would be more than sufficient</p>
<p>and remember that there is no need to overcomplicate things by adding features that is nice to have, rather than have to have.  it is a bad practice on mobile or pc.</p>
<h4>prototype it</h4>
<p>a while back i read a blog post written by <a href="http://fronttoback.org/" title="User experience" target="_blank">phil barret</a>, an user-experience guru , who used <a href="http://fronttoback.org/2008/08/11/to-scale-paper-prototyping-for-the-home/" title="Phil's prototyping method" target="_blank">prototyping to do the layout of his new home using newspapers</a>.  this is probably the best analogy you can use to describe the importance of prototyping your designs to control the flow of your site.</p>
<h4>design for the right device</h4>
<p>group mobile devices into specific groups, for e.g. low, middle and high.  where your low end would be your <a href="http://www.gsmarena.com/nokia_2610-1525.php" title="Nokia 2610" target="_blank">nokia 2610</a>, middle would be <a href="http://www.gsmarena.com/sony_ericsson_w890-2172.php" title="Sony erricsson" target="_blank">sony ericsson w890</a> and the rest, high end devices, such as the <a href="http://www.gsmarena.com/apple_iphone_3g-2424.php" title="iPhone" target="_blank">iphone</a>, <a href="http://www.gsmarena.com/palm_treo_650-907.php" title="Palm" target="_blank">palm</a> and other feature rich pda devices.</p>
<p>it would make sense to deliver more text-based content to lower end phones and more graphic rich sites to high end phones.  and make sure your features apply to the phone&#8217;s capabilities.  you shouldn&#8217;t give someone the option of uploading images if his phone doesn&#8217;t support it.  this could be achieved by using something like <a href="http://www.tera-wurfl.com/" title="tera-wurfl" target="_blank">tera-wurfl</a>.</p>
<h4>standardise</h4>
<p>make sure you comply with the industry standards.  for e.g. using <a href="http://en.wikipedia.org/wiki/XHTML_Mobile_Profile" title="XHTML Mobile Profile" target="_blank">XHTML-MP</a> as your markup language and something like <a href="http://www.developershome.com/wap/wcss/" title="WCSS" target="_blank">WCSS</a> as your presentation markup.  specify your doctype, character encoding and use well formed html code.  you can visit the <a href="http://www.openmobilealliance.org/" title="Open Mobile Alliance" target="_blank">oma</a> for more information.</p>
<p>this gives you more flexibility and would cut down on rendering issues in your mobile browser.</p>
<p>this is only very basic advice, and by no means do i advocate this as being the most correct approach, but it should give you some direction and hopefully a bit of a mind shift when it comes to mobile development.</p>
<h4>some usefull links:</h4>
<ul>
<li>wap 2 specifications &#8211; <a href="http://www.openmobilealliance.org/tech/affiliates/wap/wap-277-xhtmlmp-20011029-a.pdf" title="wap 2 specs" target="_blank">http://www.wapforum.org/what/technical.htm</a></li>
<li>XHTML-MP &#8211; <a href="http://www.openmobilealliance.org/tech/affiliates/wap/wap-277-xhtmlmp-20011029-a.pdf" title="XHTML-MP specs" target="_blank">http://www.openmobilealliance.org/tech/affiliates/wap/wap-277-xhtmlmp-20011029-a.pdf</a></li>
<li>comparison between XHTML-MP and XHTML basic &#8211; <a href="http://pc.dev.mobi/?q=node/119" title="Compare XHTML-MP and basic" target="_blank">http://pc.dev.mobi/?q=node/119</a></li>
<li>mobile web best practices &#8211; <a href="http://www.w3.org/TR/mobile-bp/" title="Best practices in mobile web" target="_blank">http://www.w3.org/TR/mobile-bp/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dewaldbotha.co.za/2009/01/26/centering-mobile-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

