<?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>wongpk &#187; Mobile</title>
	<atom:link href="http://www.wongpk.com/tag/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wongpk.com</link>
	<description>blog of a borneo web designer</description>
	<lastBuildDate>Fri, 03 May 2013 20:24:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>What is mobile apps?</title>
		<link>http://www.wongpk.com/2012/03/09/what-is-mobile-apps/</link>
		<comments>http://www.wongpk.com/2012/03/09/what-is-mobile-apps/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 15:30:51 +0000</pubDate>
		<dc:creator>wong</dc:creator>
				<category><![CDATA[Discovery]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[App]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Phone]]></category>

		<guid isPermaLink="false">http://www.wongpk.com/?p=4203</guid>
		<description><![CDATA[Every now and then, people ask, can you do a mobile app for my website? Well, no. I don&#8217;t do mobile apps at all. I&#8217;m a web designer, do website, and mobile website. So what exactly the need of mobile app for your website? The wrong perception people are getting is that, mobile app helps [...]]]></description>
				<content:encoded><![CDATA[<p>Every now and then, people ask, can you do a mobile app for my website? Well, no. I don&#8217;t do mobile apps at all. I&#8217;m a web designer, do website, and mobile website.</p>
<p><img src="http://i31.photobucket.com/albums/c376/wongpk/wongpk/mobile_phone.jpg" alt="Mobile phone" /></p>
<p>So what exactly the need of mobile app for your website? The wrong perception people are getting is that, mobile app helps their visitor go through their website easier &#8211; Yeah right. By downloading and installing an app to their mobile phone, then open up the mobile app just to see a duplicate content from your website? Instead of click to browser, type in address or better yet, scan the QR code on your business card and go to your website.</p>
<p>If you are running just a website, even an e-commerce, there is no need of a mobile app, but a mobile website. A mobile website works wonder if you take a look into it instead of taking time and cost to build a mobile app, that afterall, showing the same thing over again. It&#8217;s like installing a <a href="http://www.reidsupply.com/products/pneumatics-hydraulics/industrial-hydraulics/hydraulic-pumps/">hydraulic pumps</a> on your apartment, even the water is strong enough already.</p>
<p>As a web app enthusiastic, I believe that my &#8220;smart phone&#8221; can work wonder without much apps installed it in. You should too, consider a mobile website instead of mobile app. Because once you go to mobile app, you&#8217;ll need to create, iPhone app, Android app, BlackBerry app or maybe a Symbian app as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wongpk.com/2012/03/09/what-is-mobile-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto detect mobile style with WordPress</title>
		<link>http://www.wongpk.com/2010/09/27/auto-detect-mobile-style-with-wordpress/</link>
		<comments>http://www.wongpk.com/2010/09/27/auto-detect-mobile-style-with-wordpress/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 06:04:32 +0000</pubDate>
		<dc:creator>wong</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.wongpk.com/?p=2995</guid>
		<description><![CDATA[Mobile web and mobile web applications are both serious hit into the market nowadays. Even though Malaysia system is a bit slow, but the users are growing. With WordPress, there is not much you can do with mobile version, beside getting a plugin like WordPress mobile edition or a third party web app like mobify. [...]]]></description>
				<content:encoded><![CDATA[<p>Mobile web and mobile web applications are both serious hit into the market nowadays. Even though Malaysia system is a bit slow, but the users are growing. With WordPress, there is not much you can do with mobile version, beside getting a plugin like <a href="http://wordpress.org/extend/plugins/wordpress-mobile-edition">WordPress mobile edition</a> or a third party web app like  <a href="http://www.mobify.me">mobify</a>.</p>
<p><img src="http://i31.photobucket.com/albums/c376/wongpk/wongpk/mobile_web.jpg" alt="Mobile web" /></p>
<p>I am not keen with a list of plugins in my admin panel, so I found quite an useful <a href="http://mobility.mobi/showthread.php?22-Auto-detecting-PC-Mobile-and-then-Redirecting">snippet in a forum</a> discussing how to automatic detect mobile browser and sent users to the mobile version . The snippet looks like this:</p>
<pre>&#60;?php

$mobile_browser = '0';

if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i',
    strtolower($_SERVER['HTTP_USER_AGENT']))){
    $mobile_browser++;
    }

if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')&#62;0) or 
    ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))){
    $mobile_browser++;
    }

$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array(
    'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
    'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
    'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
    'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
    'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
    'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
    'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
    'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
    'wapr','webc','winw','winw','xda','xda-');

if(in_array($mobile_ua,$mobile_agents)){
    $mobile_browser++;
    }
if (strpos(strtolower($_SERVER['ALL_HTTP']),'OperaMini')&#62;0) {
    $mobile_browser++;
    }
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')&#62;0) {
    $mobile_browser=0;
    }


if($mobile_browser&#62;0){
   header('Location: <a href="http://YourSite.mobi/mobile" rel="nofollow">http://YourSite.mobi/mobile</a>');
   } else {
   header('Location: <a href="http://YourSite.mobi/pc" rel="nofollow">http://YourSite.mobi/pc</a>');
   }
   
?&#62;</pre>
<p>While it will automatic redirect users to the mobile version, it can however not direct users to another URL but another style sheet too.</p>
<pre>if($mobile_browser&#62;0){
   echo "&#60;link rel=\"stylesheet\" href=\""; echo bloginfo('stylesheet_directory'); echo "/mobile.css\" type=\"text/css\" media=\"handheld\" /&#62;";
   } else {
   echo "&#60;link rel=\"stylesheet\" href=\""; echo bloginfo('stylesheet_directory'); echo "/screen.css\" type=\"text/css\" media=\"handheld\" /&#62;";
   }</pre>
<p>WordPress theme need <code>style.css</code>. All the information about the theme should be within <code>style.css</code> too. So I only place information on <code>style.css</code> and the rest of my CSS will bne in <code>screen.css</code>.</p>
<p>In <code>functions.php</code>, create the auto detect function:</p>
<pre>function mobile_screen() {
$mobile_browser = '0';

if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone)/i',
  strtolower($_SERVER['HTTP_USER_AGENT']))){
  $mobile_browser++;
  }

if((strpos(strtolower($_SERVER['HTTP_ACCEPT']),'application/vnd.wap.xhtml+xml')&#62;0) or 
  ((isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE'])))){
  $mobile_browser++;
  }

$mobile_ua = strtolower(substr($_SERVER['HTTP_USER_AGENT'],0,4));
$mobile_agents = array(
  'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
  'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
  'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
  'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
  'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
  'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
  'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
  'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
  'wapr','webc','winw','winw','xda','xda-');

if (in_array($mobile_ua,$mobile_agents)) {$mobile_browser++;}
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'OperaMini')&#62;0) {$mobile_browser=0;}
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')&#62;0) {$mobile_browser=0;}

if($mobile_browser&#62;0){
  echo "&#60;link rel=\"stylesheet\" href=\""; echo bloginfo('stylesheet_directory'); echo "/mobile.css\" type=\"text/css\" media=\"handheld\" /&#62;";
  } else {
  echo "&#60;link rel=\"stylesheet\" href=\""; echo bloginfo('stylesheet_directory'); echo "/screen.css\" type=\"text/css\" media=\"screen\" /&#62;";
  }
}</pre>
<p>It is to be easy for front-end developing. For <code>header.php</code>, you&#8217;ll need to look for the function and display it:</p>
<pre>&#60;?php if (function_exists('mobile_screen') ) { mobile_screen(); } ?&#62;</pre>
<p>Do let me know if there is another easier way to do so, cause this is not a good way to implement as a mobile web yet. By the way, you can learn more about mobile web tips and technique <a href="http://www.cameronmoll.com/archives/000577.html">here</a>. Have fun! <img src='http://www.wongpk.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.wongpk.com/2010/09/27/auto-detect-mobile-style-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
