<?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>Scott Rockers&#039; Blog &#187; iPhone</title>
	<atom:link href="http://scottrockers.com/blog/tag/iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://scottrockers.com/blog</link>
	<description>Website Designer and Developer, Flash, Wordpress, jQuery, and Other Scripts</description>
	<lastBuildDate>Mon, 22 Aug 2011 21:48:12 +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>Detect Iphone</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/detect-iphone</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/detect-iphone#comments</comments>
		<pubDate>Thu, 11 Mar 2010 14:46:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=983</guid>
		<description><![CDATA[I got inspired and wanted to finish up the iphone version of my website. To do this, first you need to detect the iphone and then redirect the user to another webpage. Here is the script to do that: 1 2 3 4 5 &#60;script type=&#34;text/javascript&#34;&#62;// &#60;![CDATA[ if &#40;&#40;navigator.userAgent.indexOf&#40;'/iPhone/i'&#41; != -1&#41; &#124;&#124; &#40;navigator.userAgent.indexOf&#40;'/iPod/i'&#41; != -1&#41;&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://scottrockers.com/blog/wp-content/uploads/2010/03/iphonewebsite.jpg" rel="shadowbox[post-983];player=img;"><img src="http://scottrockers.com/blog/wp-content/uploads/2010/03/iphonewebsite.jpg" alt="" title="iphonewebsite" width="473" height="316" class="aligncenter size-full wp-image-985" /></a><br />
I got inspired and wanted to finish up the iphone version of my website. To do this, first you need to detect the iphone and then redirect the user to another webpage. Here is the script to do that:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/iPhone/i'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/iPod/i'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://www.scottrockers.com/iphone.html&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// ]]&gt;&lt;/script&gt;</span></pre></td></tr></table></div>

<p>Add this Javascript inside your &lt;head&gt; tags. and change the document.location to the page you want the user to get redirected to. The reason I have a iPhone version of my website is because my home page is made in Flash and as you know the iPhone can&#8217;t display Flash yet. So I created a basic html page that has a div in the body of it that is sized to 300 width by 350 height. And if you put this line of script in the &lt;head&gt; section it will tell Safari that the viewport should be the same size as the iPhone screen. Setting this line of code forces the content to always fit the window.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0; maximum-scale=1.0;&quot;&gt;</pre></td></tr></table></div>

<p>Now, if someone wants to bookmark your website, they can hit the + sign and then click &#8220;Add to Home Screen&#8221; and you want to specify what icon to use for the iPhone, then create a 57px by 57px .png formatted image, put it up on your server and put this line of code in to your &lt;head&gt; section as well.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;http://www.scottrockers.com/library/images/sriphonelogo.png&quot;/&gt;</pre></td></tr></table></div>

<p><a href="http://scottrockers.com/blog/wp-content/uploads/2010/03/iphoneclip.jpg" rel="shadowbox[post-983];player=img;"><img src="http://scottrockers.com/blog/wp-content/uploads/2010/03/iphoneclip.jpg" alt="" title="iphoneclip" width="436" height="302" class="aligncenter size-full wp-image-986" /></a><br />
Just make sure the href tag is the correct destination to your image. What is cool is that you don&#8217;t have to add the corners or shine effect on the webclip because  the iPhone will do that for you.</p>
<p>If you want to see all the actual html code, you can just go to <a href="http://www.scottrockers.com/iphone.html">scottrockers.com iPhone Version</a> and click view source.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/detect-iphone/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Detect iPhone and Redirect to iPhone Version Website</title>
		<link>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-iphone-and-redirect-to-iphone-version-website</link>
		<comments>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-iphone-and-redirect-to-iphone-version-website#comments</comments>
		<pubDate>Wed, 09 Dec 2009 15:18:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Simple Code Tricks]]></category>
		<category><![CDATA[Detection]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=774</guid>
		<description><![CDATA[I came across a useful snippet of code that I wanted to pass on and post about. It detects whether the person viewing your website is on a iPhone or computer. If they are on a iPhone, you can redirect them to a iPhone version website or just to another page, its up to you. [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a useful snippet of code that I wanted to pass on and post about. It detects whether the person viewing your website is on a iPhone or computer. If they are on a iPhone, you can redirect them to a iPhone version website or just to another page, its up to you. If they are on the computer it doesn&#8217;t redirect them and they go on as normal. Its just some simple javascript, and if you want to use it just change the &#8220;document.location&#8221; value to the url you want them redirected.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #006600; font-style: italic;">// &lt;![CDATA[</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/iPhone/i'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">userAgent</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/iPod/i'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		document.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://www.scottrockers.com/iphone.html&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">// ]]&gt;&lt;/script&gt;</span></pre></td></tr></table></div>

<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-iphone-and-redirect-to-iphone-version-website/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>31 Days of iPhone Apps</title>
		<link>http://scottrockers.com/blog/resources/useful-websites/31-days-of-iphone-apps</link>
		<comments>http://scottrockers.com/blog/resources/useful-websites/31-days-of-iphone-apps#comments</comments>
		<pubDate>Thu, 15 Jan 2009 16:03:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useful Websites]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.rockerssoft.org/scott/blog/?p=201</guid>
		<description><![CDATA[I just found a new site today that wrote 31 iPhone applications in 31 days, its called AppsAmuck.  And I think its a good place to start to create my own iPhone App.  I have been thinking about doing this for a little while now because my wife got an iPhone for Christmas.  I want [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.apple.com/iphone/"><img class="aligncenter size-full wp-image-206" title="iphoneappstore" src="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/iphoneappstore.jpg" alt="iPhone App Store" width="176" height="310" /></a></p>
<p>I just found a new site today that wrote 31 iPhone applications in 31 days, its called <a title="AppsAmuck" href="http://appsamuck.com/" target="_blank">AppsAmuck</a>.  And I think its a good place to start to create my own iPhone App.  I have been thinking about doing this for a little while now because my wife got an iPhone for Christmas.  I want to see what I can do with it, because I really love the interface and motion controls of the iPhone.</p>
<p>There have been a few hiccups I have come across already while researching this. First off, the <a title="iPhone Dev Center" href="http://developer.apple.com/iphone/" target="_blank">iPhone Development Center</a> says that the SDK to develop the apps in is only available for the Mac OS X Leopard.  This is quite a big hurdle for me since I don&#8217;t have a Mac, but my brother (<a title="Adam Rockers' Blog" href="http://www.rockerssoft.org/arockers/" target="_blank">Adam</a>) has already started trying to figure out what to do about this. So Adam and Mark, a co-worker of ours, have gotten Leopard to work on his a virtual machine running on Windows, now we just have to replicate his process.  The second hiccup is that to publish these apps to the actual app Store on the iPhone, you have to pay a licence fee of $99.  I guess this can come later if actually do come up with some cool apps. So it may take a little longer than I thought it would to get started but it will happen.</p>
<p>I will post an update once I know more.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/useful-websites/31-days-of-iphone-apps/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

