<?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>Bugzappy&#039;s Blog &#187; programming</title>
	<atom:link href="http://www.bugzappy.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bugzappy.com</link>
	<description>on building internet apps</description>
	<lastBuildDate>Mon, 25 Jan 2010 14:24:31 +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>Setting the ID of new database records in Ruby-on-Rails</title>
		<link>http://www.bugzappy.com/2009/10/17/setting-the-id-of-new-database-records-in-ruby-on-rails/</link>
		<comments>http://www.bugzappy.com/2009/10/17/setting-the-id-of-new-database-records-in-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 04:30:02 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[find_or_create_by_id]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[seed]]></category>
		<category><![CDATA[send]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=350</guid>
		<description><![CDATA[Switching over from Zend Framework to Ruby-on-Rails presents stumbling blocks. Rails wants to manage your database from A-to-Z. Fair enough.
But. When it comes to inserting data into it via rake db:migrate or rake db:seed (the latter being the correct way of managing your data separately from your schema), you may encounter outright frustration: Rails will [...]]]></description>
			<content:encoded><![CDATA[<p>Switching over from Zend Framework to Ruby-on-Rails presents stumbling blocks. Rails wants to manage your database from A-to-Z. Fair enough.</p>
<p>But. When it comes to inserting data into it via <strong>rake db:migrate</strong> or<strong> rake db:seed</strong> (the latter being the correct way of managing your data separately from your schema), you may encounter outright frustration: Rails will not let you set the id of the records!</p>
<p>For example, you write</p>
<blockquote><p>Singer.find_or_create_by_id(:id =&gt; 100, :name =&gt; &#8220;Donna Summer&#8221;, :rating =&gt; 2)</p></blockquote>
<p>but in your database, Dona&#8217;s id is just 1, or whatever the next available AUTO INCREMENT number was. I feel love &#8212; not.</p>
<p>There are at least two solutions, that hinge on getting around the fact the <strong>id </strong>is a <em>protected </em>attribute. First one:</p>
<blockquote><p>singer.find_or_create_by_id (:id =&gt; 100, :name =&gt; &#8220;Dona Summers&#8221;, :rating =&gt; 2) {|record| record.id = 100}</p></blockquote>
<p>or you can make use of the <strong>attributes=</strong> method of <strong>ActiveRecord::Base</strong> in the following way:</p>
<blockquote><p>Singer.attributes=({ :name =&gt; &#8216;Donna Summer&#8217;, :rating =&gt; 2}, false)</p></blockquote>
<p>The <em>false </em>passed as third parameter means &#8220;do not protect the protected attributes&#8221;. The RoR API documentation puts it this way:</p>
<blockquote><p><strong>attributes=</strong>(new_attributes, guard_protected_attributes = true)</p>
<p style="font-family: 'Bitstream Vera Sans', Verdana, Arial, Helvetica, sans-serif; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #ffffff; color: #000000; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-size: small; background-position: initial initial;">Allows you to set <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002266">all</a> the <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002348">attributes</a> at once by passing in a <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002357">hash</a> with keys matching the attribute names (which again matches the column names).</p>
<p style="font-family: 'Bitstream Vera Sans', Verdana, Arial, Helvetica, sans-serif; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #ffffff; color: #000000; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-size: small; background-position: initial initial;">If <tt>guard_protected_attributes</tt> is true (the default), then sensitive <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002348">attributes</a> can be protected from this form of mass-assignment by using the <tt><a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002280">attr_protected</a></tt> macro. Or you can alternatively specify which <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002348">attributes</a> <strong>can</strong> be accessed with the <tt><a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002281">attr_accessible</a></tt> macro. Then <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002266">all</a> the <a style="color: #0000ff; text-decoration: none;" href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002348">attributes</a> not included in that won‘t be allowed to be mass-assigned.</p>
</blockquote>
<p style="font-family: 'Bitstream Vera Sans', Verdana, Arial, Helvetica, sans-serif; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #ffffff; color: #000000; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-size: small; background-position: initial initial;">Look it up on <a href="http://api.rubyonrails.org/">http://api.rubyonrails.org/</a></p>
<p style="font-family: 'Bitstream Vera Sans', Verdana, Arial, Helvetica, sans-serif; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: #ffffff; color: #000000; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-size: small; background-position: initial initial;">
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/10/17/setting-the-id-of-new-database-records-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PhoneGap Getting an Informal Second Chance with Apple</title>
		<link>http://www.bugzappy.com/2009/06/22/phonegap-getting-an-informal-second-chance-with-apple/</link>
		<comments>http://www.bugzappy.com/2009/06/22/phonegap-getting-an-informal-second-chance-with-apple/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:53:51 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=264</guid>
		<description><![CDATA[Mike Nachbaur, who is a PhoneGap developer and contributor, made some significant inroads with the App Store review process, as it applies to code written on the PhoneGap framework. Thanks to his work and to the diligence of one of the application reviewers at Apple, one could say that PhoneGap has a solid, if informal, contact [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nachbaur.com" target="_blank">Mike Nachbaur</a>, who is a PhoneGap developer and contributor, made some significant inroads with the App Store review process, as it applies to code written on the <a href="http://www.phonegap.com" target="_blank">PhoneGap </a>framework. Thanks to his work and to the diligence of one of the application reviewers at Apple, one could say that PhoneGap has a solid, if informal, contact with Apple. If you have an interest in PhoneGap, read Mike&#8217;s <a href="http://nachbaur.com/blog/updates-on-apple-phonegap" target="_blank">blog post</a>.</p>
<p>We eagerly await further news.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/06/22/phonegap-getting-an-informal-second-chance-with-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Programmer&#8217;s &#8220;Pre-Launch Checklist &#8221; in php&#124;architect</title>
		<link>http://www.bugzappy.com/2009/06/02/a-programmers-pre-launch-checklist-in-phparchitect/</link>
		<comments>http://www.bugzappy.com/2009/06/02/a-programmers-pre-launch-checklist-in-phparchitect/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 04:15:12 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[checklist]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web.application]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=234</guid>
		<description><![CDATA[About 4 weeks ago I posted a blog entry with a long list of things to think about before exposing your code, data and CPU&#8217;s to the masses. My list is really written for people whose head is on the block if things go wrong, and is really concerned with &#8220;have you thought about all [...]]]></description>
			<content:encoded><![CDATA[<p>About 4 weeks ago I posted a <a href="http://www.bugzappy.com/2009/04/11/web-application-go-live-checklist/" target="_blank">blog entry</a> with a long list of things to think about before exposing your code, data and CPU&#8217;s to the masses. My list is really written for people whose head is on the block if things go wrong, and is really concerned with &#8220;have you thought about all the categories of things that can go wrong?&#8221;</p>
<p>In this month&#8217;s FREE <a href="http://www.phparch.com/" target="_blank">php|architect</a> issue (available only in PDF), <a href="http://phparch.com/c/magazine/author/227" target="_blank">Eric David Benari</a> provides a list of much more specific things to check on the implementation side. It almost sounds like &#8220;did you brush your teeth before going to bed?&#8221; (I say this in a good way), with things such as having your 404 and 403 pages set up properly, ensuring browser-side caching is specified correctly, serving data and files from RAM not from disk as much as possible, and more. It&#8217;s a useful list with good sample code, I recommend it to new web developers as an overview of what aspects of coding for performance deserve attention, and to more experienced coders as a handy cheat sheet.</p>
<p>Now for a bit of a critique. Some of these coding techniques will help a site&#8217;s quality a lot, but frankly, if you are testing, then you&#8217;ll find out about these issues earlier than at the time of going through the checklist. </p>
<p>Others will increase your site&#8217;s performance by a lot, but if you are benchmarking your app to meet a specific demand, then you&#8217;ll know there is a problem (or not) before you look at the checklist.</p>
<p>What really matters is that (a) the way you&#8217;ve coded your app and deployed it, it will provide the expected quality of service, and (b) when you need to improve performance, you have a solid idea of how to do so (improve the code, re-code, add hardware resources.) The techniques outlined in Eric&#8217;s article are key to both.</p>
<p>So I&#8217;m going to stay with my more abstract <em>checklists</em>, along which I have very concrete <em>toolboxes</em> such as the &#8220;coding checklist&#8221; in Eric&#8217;s php|architect article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/06/02/a-programmers-pre-launch-checklist-in-phparchitect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple, We Need Phonegap Allowed in the App Store!</title>
		<link>http://www.bugzappy.com/2009/06/01/apple-we-need-phonegap-allowed-in-the-app-store/</link>
		<comments>http://www.bugzappy.com/2009/06/01/apple-we-need-phonegap-allowed-in-the-app-store/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 16:15:57 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[commentary]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[phonegap]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=229</guid>
		<description><![CDATA[At our company we have been planning to use phonegap.com to develop on the iPhone, for 3 reasons: (1) makes use of languages we already know well, (2) should save us development time, and (3) should help us target applications to multiple mobile operating systems (iPhone, Android, Blackberry). 
However recently Apple has rejected a number of phonegap-based apps [...]]]></description>
			<content:encoded><![CDATA[<p>At our company we have been planning to use <a href="http://www.phonegap.com" target="_blank">phonegap.com</a> to develop on the iPhone, for 3 reasons: (1) makes use of languages we already know well, (2) should save us development time, and (3) should help us target applications to multiple mobile operating systems (iPhone, Android, Blackberry). </p>
<p>However recently Apple has rejected a number of phonegap-based apps &#8212; see <a href="http://blog.nachbaur.com/2009/05/open-letter-to-apple-iphone-developer.html">Mike Nachbaur&#8217;s blog</a> &#8212; needless to say we are concerned, and the phonegap people (developers and users alike) are bordering on outraged, and certainly scared. Mike Nachbaur did the right thing and sent Apple a politely written open letter, which they acknolwegded but apparently have not responded to yet.</p>
<p>Ajaxian <a href="http://ajaxian.com/archives/someone-at-apple-please-review-stance-on-phonegap">complained</a>, and ReadWriteWeb <a href="http://www.readwriteweb.com/archives/why_is_apple_rejecting_phonegap-built_iphone_apps.php">offered some potential reasons</a> for Apple to be rejecting phonegap apps. Not least of which being that Apple may want to make cross-platform development more difficult than it has to be.</p>
<p>To us at Logimake this <em>may </em>mean the following:</p>
<ol>
<li>Because our time spent learning and developing for the iPhone will not easily benefit our strategy on other mobile platforms, we will have to spend more time right now on Android and Blackberry (using phonegap, perhaps), to compensate for the loss of synergy</li>
<li>Because it is still not clear yet whether the iPhone will become a serious player in the enterprise, that loss of synergy is making it doubly imperative to develop on a Blackberry-enabled platform like phonegap. </li>
</ol>
<p>Apple&#8217;s forte on the iPhone is in consumer apps, and it has lots to prove in enterprise apps &#8212; and integration. By keeping cross-platform frameworks, and hence applications, at bay, Apple may be reducing its own potential success in the enterprise.</p>
<p>We are eagerly waiting any news from Mike or Apple.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/06/01/apple-we-need-phonegap-allowed-in-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems Playing Videos in iPhone Simulator</title>
		<link>http://www.bugzappy.com/2009/05/18/problems-playing-videos-in-iphone-simulator/</link>
		<comments>http://www.bugzappy.com/2009/05/18/problems-playing-videos-in-iphone-simulator/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:54:43 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[DivX]]></category>
		<category><![CDATA[simulator]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=208</guid>
		<description><![CDATA[We had a problem on some of our Macs where the iPhone simulator would not play videos that we encoded and embedded in an iPhone application that we built. However these videos would play just fine on their own, and also they would play just fine on a real iPhone, without any changes.
Apple support forum [...]]]></description>
			<content:encoded><![CDATA[<p>We had a problem on some of our Macs where the iPhone simulator would not play videos that we encoded and embedded in an iPhone application that we built. However these videos would play just fine on their own, and also they would play just fine on a real iPhone, without any changes.</p>
<p>Apple support forum has some answers:</p>
<p><a href="http://discussions.apple.com/thread.jspa?messageID=8538445">http://discussions.apple.com/thread.jspa?messageID=8538445</a></p>
<p>Particularly helpful:</p>
<blockquote><p>This fixed it for me.</p>
<p>I moved :<br />
DivX Decoder.component<br />
DivX Encoder.component</p>
<p>out of the directory:<br />
/Library/Quicktime<br />
The video player used to not play files that I encoded myself. Now it does.</p>
<p>Thanks </p>
<p><em>ed.anisko</em></p></blockquote>
<p>I did exactly that and everything worked fine. Note: I don&#8217;t use DivX so I cannot be sure that this quick fix will not break something important to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/05/18/problems-playing-videos-in-iphone-simulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Separate PHP Debug Output from HTML Page Content</title>
		<link>http://www.bugzappy.com/2009/04/23/separate-php-debug-output-from-html-page-content/</link>
		<comments>http://www.bugzappy.com/2009/04/23/separate-php-debug-output-from-html-page-content/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 09:21:15 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[MVC]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=172</guid>
		<description><![CDATA[I wrote a simple class today to help me organize my debug messages in PHP, while keeping the generated HTML intact (mostly). 
Personally, I like to output all the debug messages at the bottom of my html page (structurally speaking, and layout-wise). This way I can see how the output renders for real, and if something [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote a simple class today to help me organize my debug messages in PHP, while keeping the generated HTML intact (mostly). </p>
<p>Personally, I like to output all the debug messages at the bottom of my html page (structurally speaking, and layout-wise). This way I can see how the output renders for real, and if something looks fishy I have the luxury of a potentially large set of debug messages that I can read through, looking for fishy stuff.</p>
<p>It&#8217;s just a glorified &#8216;echo&#8217; function; but one which lets you decide where to actually output the debug messages in your generated HTML. Or you can think of it as a mini-logging function, that lasts for the time of just one HTTP response; and as a programmer you can do whatever you want with the &#8216;log&#8217;, i.e. output it any way you like.</p>
<p>In fact it is similar to what placeholders do for you within the Zend_View system, i.e. prepare some output but defer when it is actually outputted. In this case, the output is generated from within the controllers, models, and helper classes though, so that&#8217;s why I had to, in some sense, duplicate what ZF already provides for views.</p>
<p>Here is a quick tutorial:</p>
<p>First, download the <a href="http://www.bugzappy.com/wp-content/uploads/2009/04/debugoutputphp.txt">DebugOutput class</a> and rename the file to DebugOutput.php</p>
<p>In a strategic place in your code (for instance the init method of your controller in Zend Framework), include the php file and set the type of debug output you would like (none, inlined within &lt;pre&gt; &#8230; &lt;/pre&gt;, inlined within &lt;!&#8211; &#8230; &#8211;&gt;, or deferred to your view):</p>
<pre>...
public function init()
{
        require_once '..../DebugOutput.php';

	if ( ... /* if in development mode */ ... )
		DebugOutput::setOutputType(DebugOutput::DEFERRED_OUTPUT );
	else
		DebugOutput::setOutputType(DebugOutput::NO_OUTPUT );
	}
...</pre>
<p> </p>
<p>Then in your code, you call the _debug() function as often as needed:</p>
<pre>...

_debug($thisVariable, 'this variable');

...

_debug($thatVariable, 'that variable');

...</pre>
<p> </p>
<p>Before you rendering engine / view engine / smarty / Zend_View takes over, you make the debug messages available to it in the following fashion (here assuming we are using a Zend Framework Action Controller, i.e. the Zend_Controller_Action class):</p>
<pre>...
public function postDispatch()
{
        ...
    	$this-&gt;view-&gt;debugOutput = DebugOutput::getDeferredOutput();
}
...</pre>
<p> </p>
<p>And finally, at the bottom of your layout / wrapper / main view (in this case my Zend Framework layout), the debug messages are in an array, available to your rendering engine, and so you can treat them like any other output, for instance like this:</p>
<pre>...
&lt;?php if (!empty($this-&gt;debugOutput)) { ?&gt;
&lt;div style="background-color: #ffe0e0;
	width: 96%; padding-left: 2%; padding-right: 2%; padding-top: 50px; padding-bottom: 50px; margin-bottm: 100px;
	border: 1px dotted red; overflow: auto; float: none"&gt;
&lt;p style="font-weight: bold; color: red; text-align: center"&gt;DEBUG INFO&lt;/p&gt;
&lt;pre&gt;
&lt;br /&gt;
&lt;?php     if (is_array($this-&gt;debugOutput))
                    foreach ($this-&gt;debugOutput as $debugElement) { ?&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;?= $debugElement['label'] ?&gt;:
&lt;?= print_r($debugElement['value'], true) ?&gt;
&lt;?php         } ?&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;?php     } ?&gt;
&lt;/body&gt;
...</pre>
<p> </p>
<p>I hope someone finds it useful or gets some better ideas from it. If so, please share :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/04/23/separate-php-debug-output-from-html-page-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building iPhone Applications which Synchronize Local Data with a Server</title>
		<link>http://www.bugzappy.com/2009/04/22/building-iphone-applications-which-synchronize-local-data-with-a-server/</link>
		<comments>http://www.bugzappy.com/2009/04/22/building-iphone-applications-which-synchronize-local-data-with-a-server/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 19:01:30 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[data synchronization]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[iAnywhere]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=170</guid>
		<description><![CDATA[Not an easy one to solve, for the moment. But doable yet:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/6239-database-sync-between-iphone-server.html
http://blogs.sybase.com/ithain/?p=577
Who else has reusable components for a solution?
]]></description>
			<content:encoded><![CDATA[<p>Not an easy one to solve, for the moment. But doable yet:</p>
<p><a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/6239-database-sync-between-iphone-server.html">http://www.iphonedevsdk.com/forum/iphone-sdk-development/6239-database-sync-between-iphone-server.html</a></p>
<p><a href="http://blogs.sybase.com/ithain/?p=577">http://blogs.sybase.com/ithain/?p=577</a></p>
<p>Who else has reusable components for a solution?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/04/22/building-iphone-applications-which-synchronize-local-data-with-a-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming the iPhone: native or web application?</title>
		<link>http://www.bugzappy.com/2009/04/03/programming-the-iphone-native-or-web-application/</link>
		<comments>http://www.bugzappy.com/2009/04/03/programming-the-iphone-native-or-web-application/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 19:40:36 +0000</pubDate>
		<dc:creator>bugzappy</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[mobile.application]]></category>
		<category><![CDATA[native.iPhone.application]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[web.application]]></category>

		<guid isPermaLink="false">http://www.bugzappy.com/?p=87</guid>
		<description><![CDATA[We are regularly faced with the dilemma of suggesting a native iPhone application vs an iPhone-specific web application to our prospective clients. We find ourselves more at ease to develop complex applications in web-mode, and of course they can be derived from existing full-fledged web applications, and later be ported to other mobile platforms. In [...]]]></description>
			<content:encoded><![CDATA[<p>We are regularly faced with the dilemma of suggesting a native iPhone application vs an iPhone-specific web application to our prospective clients. We find ourselves more at ease to develop complex applications in web-mode, and of course they can be derived from existing full-fledged web applications, and later be ported to other mobile platforms. In addition, Apple has made it possible to let the web apps act like native apps in many respects. However in some cases a native application is the only way to provide the desired level of integration with the iPhone operating system.</p>
<p>Here is a summary of the distinctions, taken straight from Apple&#8217;s iPhone developer&#8217;s web content. </p>
<p><strong>Web Application on Safari Mobile version 4:</strong></p>
<p>You cannot arbitrarily access the iPhone&#8217;s resources (the camera, GPS, audio, files, data, applications, etc.)</p>
<p>But:</p>
<p>You can make it look and feel like a native app:</p>
<blockquote><p>
How do I ensure that my web content uses all of the available screen space on iPhone?<br />
How do I create a Home screen icon for my website or web application?<br />
How do I hide the Safari on iPhone OS UI components when my web application is running?<br />
How do I disable user zooming and scaling in my web application?<br />
How do I detect iPhone orientation changes in my web application?<br />
How do I conditionally load CSS that I have customized for iPhone?<br />
How do I launch iPhone applications, like YouTube, iTunes, or Maps, to display content?<br />
How do I dial a phone number from a webpage on iPhone?</p>
<p>(<em>read the answers at <a href="http://developer.apple.com/safari/library/codinghowtos/mobile/userExperience/index.html">Safari on iPhone User Experience Coding How-To&#8217;s</a></em>)</p></blockquote>
<p>You can make it view/play/perform content in native iPhone apps, a bit like a desktop browser plugin would, using Apple Url Scheme:</p>
<blockquote><p>
“Mail Links” describes the format for sending email with the Mail application.<br />
“Phone Links” describes the format for dialing phone numbers in the Phone application.<br />
“Text Links” describes the format for launching the Text application.<br />
“Map Links” describes the format for specifying locations in the Maps application.<br />
“YouTube Links” describes the format for linking to YouTube videos.<br />
“iTunes Links” describes the format for linking to items in the iTunes Music Store.</p>
<p>(<em>quoted from <a href="http://developer.apple.com/safari/library/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html">Apple URL Scheme Reference</a></em>)</p></blockquote>
<p>You can make it work offline:</p>
<blockquote><p>
&#8230; Safari provides an offline application cache. This cache allows you to create web-based applications that work correctly even when the user’s computer or web-enabled device is not connected to the Internet.<br />
(<em>quoted from <a href="http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/chapter_2_section_1.html">HTML 5 Offline Application Cache</a></em>)</p>
<p>&#8230; Safari supports the HTML 5 client-side storage specification.<br />
(<em>quoted from <a href="http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/Name-ValueStorage/chapter_3_section_1.html">Key-Value Storage</a></em>)</p>
<p>&#8230; Safari supports the HTML5 JavaScript database class. The JavaScript database class, based on SQLite, provides a very basic relational database intended for local storage of content that is too large to conveniently store in cookies (or is too important to accidentally delete when the user clears out his or her cookies).<br />
(<em>quoted from <a href="http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/chapter_5_section_1.html">Using the JavaScript Database</a></em>)</p>
<p>(<em>get the complete PDF document at: <a href="http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/SafariJSDatabaseGuide.pdf">Safari Client-Side Storage and Offline Applications Programming Guide</a></em>)
</p></blockquote>
<p><strong>Native iPhone application:</strong></p>
<blockquote><p>Unlike a web application, which runs in Safari, a native application runs directly as a standalone executable on an iPhone OS–based device. Native applications have access to all the features that make the iPhone interesting, such as the accelerometers, location service, and Multi-Touch interface. They can also save data to the local file system and even communicate with other installed applications through custom URL schemes.</p>
<p>(<em>quoted from <a href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html">iPhone Reference Library</a></em>)</p></blockquote>
<p>Ulitzer.com has a some stats for an informal poll on LinkedIn about which (web or native) developers seem to favor:</p>
<blockquote><p><a href="http://iphone.ulitzer.com/node/890613">Web or SDK?</a><br />
— Web Development and SDK Development each offer distinct advantages to the iPhone Developer&#8230;So I set out over the last two months, with the aid of the LinkedIn Polls feature to gauge the trend</p></blockquote>
<p>And btw they also have a simple summary of what you need to do to get your first iPhone application out there, starting from 0:</p>
<blockquote><p><a href="http://iphone.ulitzer.com/node/908465">Seven Steps to the iPhone Developer&#8217;s World</a><br />
&#8230; here are my seven steps to becoming an iPhone Developer. Tread carefully and you will become a wise man&#8230; Buy an Intel Based Mac &#038; a Device &#8211; though the iPhone/iPod Touch device isn&#8217;t 100% necessary for this early stage, as the iPhone simulator that you will get with the SDK is free and more that capable for initial development &#8230; </p></blockquote>
<p>I hope this helps clarify your options as a developer for the iPhone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bugzappy.com/2009/04/03/programming-the-iphone-native-or-web-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
