Hacker News new | ask | show | jobs
by litek 4805 days ago
Do you use phonegap for the mobile versions, or something custom with a webview?
1 comments

Phonegap, but we do a lot of custom native stuff beyond that.
Could you expand on what you mean with "custom native stuff"?
The top and bottom bars are completely native. So when you tap on a tab, your interacting with a native interface laid out in a nib and a message is passed to the javascript app inside the main web view telling it which tab has been selected. The sliding drawers (popularized by Path and Facebook) area also completely native, but they house two other webviews that also are simply running javascript apps in them. Finally, we have a slide out "quick add" menu that we determined needed to be native both because the performance when it was implemented in HTML5/CSS3 on older Android devices wasn't acceptable and also because it needed to overlap other native elements.

The main reason we need to have some native UI components is because fixed elements are not well supported on older iOS and Android devices. That means that in the webview sandwiched inbetween our top and bottom bars we cannot have any fixed ui elements. This ensures that the scrolling stays smooth on all devices because it's really just utilizing the native webview scroller. Newer versions of iOS and Android do support native-style momentum scrolling within a DIV, but the performance isn't quite there on all but the most powerful devices (for reference, Sencha Touch's http://fb.html5isready.com uses these native scrolling divs, and quite impressively too).

There are also other features that need to be native under the hood like push notifications support, camera/photo-library support, and contacts support, etc. Thankfully Phonegap makes most of that available to us and for anything that isn't available as a Phonegap plugin we simply wrote ourselves.

The way I see it, this "hybrid" approach is a necessary stopgap for us HTML5 mobile developers while we wait for more devices to reach the capability of the fastest phones available right now (iPhone 5, Galaxy S3, etc). Eventually we should be able to do almost everything in pure HTML5 like Sencha Touch's demo linked above and ditch the native UI elements completely. There will, however, always need to be some sort of bridge between HTML5 apps on Android and iOS devices and the native APIs that are not made available to those devices' mobile web browsers (contacts, camera, files, push notifications, in-app purchases, etc).

I hope that explains it in better detail. Hit me up if you have more questions, my email is in my profile.

Yes, that explains it. Thanks for taking the time to write that reply.
my pleasure!