<story><title>PhoneGap vs. Native: Some Thoughts on Going Native</title><url>https://groups.google.com/forum/#!topic/phonegap/BFyBYjQp3a8</url></story><parent_chain></parent_chain><comment><author>newhouseb</author><text>I spent an inordinate amount of time fighting webkit before switching all of our stuff to native.  The four biggest problems, I think, with the state of webkit are:&lt;p&gt;1) Implicit memory management of large images/surfaces isn&apos;t reliable. There&apos;s basically nothing you can do (outside of not doing anything) to prevent your page from crashing webkit if you use too many (where too many is undefined) accelerated elements/total texture space. There&apos;s no &quot;Running low on memory&quot; callbacks or means to explicitly remove a recently drawn image from memory outside of removing it from the DOM and crossing your fingers.&lt;p&gt;2) Lack of proper prioritization in javascript. One of the things that IOS focuses on a lot is separating out user interaction on the main thread from everything else on background threads. In JS, if you&apos;re not careful and you do an innerHTML in the wrong spot, you can lock up a bunch of user interaction or delay an AJAX request that would otherwise be executing. Maybe the answer here is something like .updateInnerHTMLWithCallback(function foo(){}) to prevent breakage of JS that does expect the DOM to be consistent after an innerHTML update. (Edit: Oh I forgot, we actually did something similar to this by doing all of our innerHTML updates in setTimeout&apos;ed functions with a 1ms delay).  There&apos;s a lot of weird stuff around loading images and keeping UI responsiveness then as well.&lt;p&gt;3) No cache beyond pure source code between separate user sessions. One of the biggest issues for us was initial load time (parsing and calculating CSS, parsing and running JS, and blitting down accelerated DOM elements, etc). Once everything was loaded we could imitate a native-level experience, but this often would be 10-15 seconds in. Perhaps an intermediate cached file (kind of like python&apos;s pyc) would help alleviate this.&lt;p&gt;4) Debugging. This was covered, but ugh, what a nightmare. At a certain point I was booting up XCode instruments and tracing through webkit code to figure out what parts of our JS/CSS/etc to optimize.</text></comment>
<story><title>PhoneGap vs. Native: Some Thoughts on Going Native</title><url>https://groups.google.com/forum/#!topic/phonegap/BFyBYjQp3a8</url></story><parent_chain></parent_chain><comment><author>blago</author><text>I am equally productive with web as well as native development so it makes no difference to me. Not surprisingly, Phonegap never appealed much - same work, inferior results, single (but dubious) benefit: cross platform.&lt;p&gt;I was pleasantly surprised by Titanium mobile though when I had to evaluate it at my job 2 years ago. I set to reimplement one of our (non-trivial) apps and summarize my experience. I ended up writing 50% less code and it took about the same time as what I had spent on the native version. I consider this a compliment though as I was completely new to Titanium. On the flip side I was completely new to the app when I wrote it the first time :-)&lt;p&gt;The build/run/debug loop was unpleasant but I&apos;ve heard that it has improved since then. As for performance, it was good - Titanium generates native UI, albeit with an interpreter in the middle.&lt;p&gt;I was quite surprised when it turned out that I have a 99% identical app. You see, from the very beginning I decided that I&apos;ll be hard on Titanium, my goal was no-compromise, high-fidelity clone. And it worked. The only problem was positioning a tooltip near a touch point - at the time there was no way to traverse the view hierarchy. But then again, maybe I could have implemented it in a different way.&lt;p&gt;I realize a lot has changed since than, but this is my 2 cents - sharing a real world/product experience.</text></comment>