<?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>Ashley Ford - Tutorials :: jQuery :: PHP :: CSS :: HTML5 :: Papermashup.com &#187; Mobile</title>
	<atom:link href="http://papermashup.com/category/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://papermashup.com</link>
	<description>Ashley Ford - Tutorials :: jQuery :: PHP :: CSS :: HTML5 :: Papermashup.com</description>
	<lastBuildDate>Thu, 03 May 2012 13:39:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using Google&#8217;s Weather API</title>
		<link>http://papermashup.com/using-googles-weather-api/</link>
		<comments>http://papermashup.com/using-googles-weather-api/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 16:46:58 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2471</guid>
		<description><![CDATA[I thought it would be a nice little project to write a tutorial on how to build a basic but powerful weather application for either mobile devices or the desktop. The application takes a set of Google weather API feeds &#8230; <br/> <a href="http://papermashup.com/using-googles-weather-api/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I thought it would be a nice little project to write a tutorial on how to build a basic but powerful weather application for either mobile devices or the desktop. The application takes a set of Google weather API feeds and makes some simple decisions based on the output. For example we can recommend the user takes an umbrella if rain or storms are forecast, or whether the temperature warrants the need for warm clothes. Basic but nonetheless useful information.</p>
<h3>The Logic Code</h3>
<p>Lets have a quick run through at what the project consists of. Firstly we use the simplexml_load_file() PHP function to get the xml data for the given location. We then check to see if the current weather condition is in the XML file. If it doesn&#8217;t exist then we can make the assumption that the API feed couldn&#8217;t determine the location, bear in mind this is very basic error checking and if the feed fails it will still return this error.</p>
<p>We now do some basic data checking to to see what extra data we can give the user. Firstly we check on line 14 to see if the current weather and forecast are different, if they are different we&#8217;ll display the forecast if not we show just the current weather.</p>
<p>Next on lines 21 and 28 we do a simple check to see if the temperature is higher or lower than 20 degrees and echo whether it&#8217;s likely to be hot or cold. </p>
<p>Finally on lines 35 we check to see if the current or future forecast contains any rain or storms so we can recommend the user takes an umbrella. This is done using some basic PHP regular expression.</p>
<pre class="brush: php; title: ;">
	// load the XML feeds for the Google Weather API
	$xml = simplexml_load_file('http://www.google.com/ig/api?weather='.urlencode($_GET['location']));
	$current = $xml-&gt;xpath(&quot;/xml_api_reply/weather/current_conditions&quot;);
	$forecast = $xml-&gt;xpath(&quot;/xml_api_reply/weather/forecast_conditions&quot;);

	// do a basic error check to see if we can get the current weather condition for the given location
	// if no return an error.
	if(!$current[0]-&gt;condition['data']){

		$error = 'Couldn\'t determine this location';

		}

	// is the current weather the same as the forecast? if not display the forecast
	if(strtolower($current[0]-&gt;condition['data'])!=strtolower($forecast[0]-&gt;condition['data'])){

	$outlook = 'but the forecast says '.strtolower($forecast[0]-&gt;condition['data']);	

		}

	// if the temp in degrees c is below 20 i.e. cold
	if($current[0]-&gt;temp_c['data']&lt;=20){

	$coat = 'If you\'re going outside i\'d wrap up warm.';	

		}	

	// if the temp in degrees c is over 21 i.e. Warm / Hot
	if($current[0]-&gt;temp_c['data']&gt;=21){

	$coat = 'You should be ok without warm clothes today.';	

		}		

	// check to see if there is rain or storms forecast
	if (preg_match(&quot;/\brain\b/i&quot;, $current[0]-&gt;condition['data']) ||
		preg_match(&quot;/\brain\b/i&quot;, $forecast[0]-&gt;condition['data']) ||
		preg_match(&quot;/\bstorm\b/i&quot;, $current[0]-&gt;condition['data']) ||
		preg_match(&quot;/\bstorm\b/i&quot;, $forecast[0]-&gt;condition['data'])
		){

		$umbrella = ' But &lt;u&gt;don\'t forget to take an umbrella&lt;/u&gt;!';
		}
</pre>
<h3>Displaying the data</h3>
<pre class="brush: php; title: ;">
&lt;form action=&quot;&quot; method=&quot;get&quot;&gt;
&lt;label for=&quot;location&quot;&gt;Location&lt;/label&gt;
&lt;input type=&quot;text&quot; class=&quot;location&quot; name=&quot;location&quot; value=&quot;&lt;?php echo $_GET['location'];?&gt;&quot;/&gt;
&lt;/form&gt; 

&lt;?php if(!empty($_GET['location'])){

	if($error){ echo '&lt;div class=&quot;errors&quot;&gt;'.$error.'&lt;/div&gt;'; }else{

?&gt;

&lt;div class=&quot;weather_app&quot;&gt;

&lt;h1&gt;Weather Summary for &lt;?php echo $_GET['location'];?&gt;&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;?php echo '&lt;img src=&quot;http://google.com'.$current[0]-&gt;icon['data'].'&quot;/&gt;'; ?&gt; The weather in &lt;?php echo $_GET['location'];?&gt; is &lt;strong&gt;&lt;?php echo strtolower($current[0]-&gt;condition['data']).' '. $outlook;?&gt;&lt;/strong&gt;. The temperature is currently &lt;strong&gt;&lt;?php echo $current[0]-&gt;temp_c['data']; ?&gt;&amp;deg;c (&lt;?php echo $current[0]-&gt;temp_f['data']; ?&gt;&amp;deg;f)&lt;/strong&gt;. &lt;?php echo $coat;?&gt; &lt;?php echo $umbrella;?&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;?php } } ?&gt;
</pre>
<p><a href="http://papermashup.com/demos/google-weather-api/?location=Bristol"><img src="http://papermashup.com/wp-content/uploads/2009/01/demo.png" alt="" title="demo" class="alignnone size-full wp-image-23" /></a> <a href="http://papermashup.com/demos/google-weather-api/google-weather-api.zip"><img src="http://papermashup.com/wp-content/uploads/2009/01/download.png" alt="download" title="download" class="alignnone size-full wp-image-24" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/using-googles-weather-api/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Optimise your site for mobile devices</title>
		<link>http://papermashup.com/optimise-your-site-for-mobile-devices/</link>
		<comments>http://papermashup.com/optimise-your-site-for-mobile-devices/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 18:15:56 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=2141</guid>
		<description><![CDATA[With the advent of smart phones and more powerful handheld devices like the iPad are your mobile users having the best experience? The mobile arena introduces a layer of complexity that can be difficult for designers and developers to accommodate. &#8230; <br/> <a href="http://papermashup.com/optimise-your-site-for-mobile-devices/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>With the advent of smart phones and more powerful handheld devices like the iPad are your mobile users having the best experience?  The mobile arena introduces a layer of complexity that can be difficult for designers and developers to accommodate. Mobile development is more than cross-browser, it should be cross-platform.</p>
<h3>Add a Mobile Stylesheet</h3>
<p>In the code below we&#8217;ve included two stylesheets, the first main.css targets desktop computers and laptops using the &#8216;screen&#8217; media type, while the second mobile.css targets mobile devices. While this would otherwise be an excellent approach, device support is another issue. Older mobile devices tend to support the handheld media type, however they vary in their implementation: some disable the screen stylesheets and only load handheld, whereas others load both.</p>
<pre class="brush: css; title: ;">
&lt;link rel=&quot;stylesheet&quot; href=&quot;main.css&quot; media=&quot;screen&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;mobile.css&quot; media=&quot;handheld&quot; /&gt;
</pre>
<h3>Make phone numbers clickable</h3>
<p>It&#8217;s easy to make phone numbers clickable, just like we can use &#8216;mailto:&#8217; to link email addresses through (although this isn&#8217;t advised due to email harvesting) we can add  &#8216;tel:&#8217; followed by the number as shown below. </p>
<pre class="brush: css; title: ;">
&lt;a href=&quot;tel:+44203948578&quot; class=&quot;phone-link&quot;&gt;(+44) 203 94 8578&lt;/a&gt;
</pre>
<h3>Make filling in forms easier</h3>
<p>HTML5 input types allows us to make it easier for users to fill in forms by providing the correct keyboard configuration. this can be achieved by changing the input type to either &#8216;email&#8217; or &#8216;tel&#8217;.</p>
<pre class="brush: css; title: ;">
&lt;input type=&quot;email&quot; name=&quot;email&quot; /&gt;
&lt;input type=&quot;tel&quot; name=&quot;telephone&quot;/&gt;
</pre>
<h3>Take if a step further with JavaScript and jQuery</h3>
<p>jQuery just released the <a href="http://jquerymobile.com/">mobile version</a> of its popular framework that allows you to use Its lightweight code is built with progressive enhancement, which also has a flexible, easily themeable design.</p>
<blockquote><p>jQuery mobile framework takes the &#8220;write less, do more&#8221; mantra to the next level: Instead of writing unique apps for each mobile device or OS, the jQuery mobile framework will allow you to design a single highly branded and customized web application that will work on all popular smartphone and tablet platforms.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/optimise-your-site-for-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Give your site an iPhone bookmark icon</title>
		<link>http://papermashup.com/give-your-site-an-iphone-bookmark-icon/</link>
		<comments>http://papermashup.com/give-your-site-an-iphone-bookmark-icon/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:47:31 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=1731</guid>
		<description><![CDATA[I recently configured my site for mobile consumption, by using the WordPress Mobile Edition plugin along with the Carrington Mobile 1.0.2 theme. I noticed when I bookmarked my site using the iPhone that the home screen icon as missing. Today &#8230; <br/> <a href="http://papermashup.com/give-your-site-an-iphone-bookmark-icon/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>I recently configured my site for mobile consumption, by using the <a href="http://wordpress.org/extend/plugins/wordpress-mobile-edition/">WordPress Mobile Edition plugin</a> along with the Carrington Mobile 1.0.2 theme. I noticed when I bookmarked my site using the iPhone that the home screen icon as missing. Today I&#8217;m going to run through how to create and setup the home icon for your website.</p>
<h3>Create the icon</h3>
<p>You will need to produce an image in PNG format that:</p>
<ul>
<li>Measures 57 x 57 pixels, with square corners the  (if the image measures other than this size, iPhone OS scales it)</li>
<li>Does not use alpha transparency</li>
<li>Does not have any shine or gloss</li>
</ul>
<p><img class="alignnone size-full wp-image-1735" title="ipod" src="http://papermashup.com/wp-content/uploads/2010/03/ipod.jpg" alt="" width="583" height="500" /></p>
<h3>The Code</h3>
<p>This part is extremely easy. there are two options, if you have access to your root directory (usually where your index.html file is kept) you can save your icon as <em>apple-touch-icon-precomposed.png</em> and the iphone or ipod will do the rest.</p>
<p>Or you can add a line of meta code to the head of your page which specifies the link to your icon.</p>
<p><strong>Glossy icon:</strong></p>
<pre class="brush: xml; title: ;">
&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;/images/iphone_icon.png&quot; /&gt;
</pre>
<p><strong>Non glossy icon:</strong></p>
<pre class="brush: xml; title: ;">
&lt;link rel=&quot;apple-touch-icon-precomposed&quot; href=&quot;/images/iphone_icon.png&quot; /&gt;
</pre>
<p><img class="alignnone size-full wp-image-1739" title="youricon" src="http://papermashup.com/wp-content/uploads/2010/03/youricon.jpg" alt="" width="583" height="203" /> </p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/give-your-site-an-iphone-bookmark-icon/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Key web development skills</title>
		<link>http://papermashup.com/key-web-development-skills/</link>
		<comments>http://papermashup.com/key-web-development-skills/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 10:53:11 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[headline]]></category>
		<category><![CDATA[Iphone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[MySpace]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[OpenID]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Advertising]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Data Portability]]></category>
		<category><![CDATA[Del.icio.us]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=1198</guid>
		<description><![CDATA[API Knowledge A key tool for any budding web developer is API knowledge. It&#8217;s good to familiarise yourself with a variety of application interfaces. I started out using the Twitter REST API with PHP and CURL when twitter first launched &#8230; <br/> <a href="http://papermashup.com/key-web-development-skills/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<h3>API Knowledge</h3>
<p>A key tool for any budding web developer is API knowledge. It&#8217;s good to familiarise yourself with a variety of application interfaces. I started out using the Twitter REST API with PHP and CURL when twitter first launched the API to basically get a users tweets, pretty simple now I look back, but at the time it was the first time i&#8217;d done such a thing. As the development of social media continues this will increasingly open up opportunities to develop more and more applications that interact with one another and and make our daily chores more eventful.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/api.jpg" alt="api" title="api" width="582" height="200" /></p>
<h3>Frameworks</h3>
<p>There&#8217;s generally a framework for just about every programming language out there. Whether you decide to learn the jQuery framework for JavaScript or Cake for PHP each one will help you succeed as a freelancer and further your career as a web developer. Frameworks in many respects take out the arduous repetitive tasks we face daily and give us more time to focus on developing cutting edge products or applications. </p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/ruby.jpg" alt="ruby" title="ruby" width="582" height="200" /></p>
<h3>iPhone Applications</h3>
<p>Companies are Increasingly seeing the massive potential that there is in the mobile platform. Applications that are approved and make it into the Apple app store have the opportunity to be downloaded thousands of times and can potentially make a lot of money. Having a specific skill to be able to develop for this market can be very lucrative, especially in the current economic climate when companies are turning to social media to plug holes where they&#8217;re not seeing return on investment from other advertising sectors.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/iphone.jpg" alt="iphone" title="iphone" width="582" height="200" /></p>
<h3>CMS Customisation</h3>
<p>A handy skill to have is a general knowledge of how to use content management systems. For example building themes and plugins for WordPress, or modules and components for Joomla and Mambo.  As a developer its important to have an idea of the structure of a variety of CMS&#8217;s. If you have a wordpress blog/site, that&#8217;s an easy way to familiarise yourself with the platform. Remember it&#8217;s always easier to learn something by immersing yourself in the technology.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/wordpress.jpg" alt="wordpress" title="wordpress" width="582" height="200" /></p>
<h3>Online Payments</h3>
<p>Businesses are always going to need payment solutions online. Having the skills to take a site and integrate  paypal or google checkout will allow you to go far. We&#8217;re starting to see many 3rd party software companies setting up and selling software at more affordable prices, take <a href="http://www.panic.com/">Panic</a> for example. They are a relatively small company that develop a selection of web development software for the mac. Many new startups are settling for a product based revenue stream rather than making money purely through ads, revenue share, or partnership deals. This opens up the demand for skilled developers to be able to build payment solutions.</p>
<p><img src="http://papermashup.com/wp-content/uploads/2009/11/google-checkout.png" alt="google-checkout" title="google-checkout" width="582" height="200"/></p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/key-web-development-skills/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Lightweight Mobile Browser Detection</title>
		<link>http://papermashup.com/lightweight-mobile-browser-detection/</link>
		<comments>http://papermashup.com/lightweight-mobile-browser-detection/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 19:09:57 +0000</pubDate>
		<dc:creator>Ashley</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://papermashup.com/?p=786</guid>
		<description><![CDATA[This simple lightweight piece of code developed by Andy Moore and modified by Mobiforge allows you to redirect your users through to a mobile version of your site. The best way to do this would be to include the following &#8230; <br/> <a href="http://papermashup.com/lightweight-mobile-browser-detection/">Continue reading</a>]]></description>
			<content:encoded><![CDATA[<p>This simple lightweight piece of code developed by <a href="http://www.andymoore.info/">Andy Moore</a> and modified by <a href="http://mobiforge.com/developing/story/lightweight-device-detection-php">Mobiforge</a> allows you to redirect your users through to a mobile version of your site. The best way to do this would be to include the following code into the top of the index page as this is most likely your first point of entry. It is advised as i did in the <a href="http://papermashup.com/ipod-and-iphone-php-detection/">iphone detection tutorial</a> found here to give users the option on mobile pages to view the original site.</p>
<div class="clear"></div>
<pre class="brush: php; title: ;">
&lt;?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')&gt;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')&gt;0) {
    $mobile_browser++;
}

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'windows')&gt;0) {
    $mobile_browser=0;
}

if($mobile_browser&gt;0) {
   // do something
}
else {
   // do something else
}   

?&gt;
</pre>
<p>Hope you find it useful <img src='http://papermashup.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://papermashup.com/lightweight-mobile-browser-detection/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 4/14 queries in 0.343 seconds using disk: basic
Object Caching 610/652 objects using disk: basic

Served from: papermashup.com @ 2012-05-17 08:32:20 -->
