3 ms·
I'm confused what the downsides are to using phonegap - Is it a speed thing? Are there features that a native client could use that phonegap can't access? Devel
by kanja 14y ago
I'm confused what the downsides are to using phonegap - Is it a speed thing? Are there features that a native client could use that phonegap can't access? Development is harder? Coming from a web background this seems like a huge boon. Why should I invest the time into learning objective-c/java compared to using phonegap?
- AshleysBrain 14y agoWell, you're stuck with the phone browser, which may suck. However, part of the reason PhoneGap is so popular is it's still quite often a great way to make an app!
- denysonique 14y agoPersonally I like the fact that PhoneGap apps are based on a webview, but unfortunately the performance of this webview seems to be very sluggish -- at least on my Samsung Galaxy SII.
- 54mf 14y agoOn iOS, the webview is certainly fast enough - no lag or stuttering in scrolling or touch events - but I've heard Android and Windows Phone still leave a lot to be desired. I haven't personally dug in to either yet, though.
- eagsalazar 14y agocss transitions are hardware accelerated on mobile safari and android chrome but not on the standard android browser. So animations are terrible on 99% of android phones. No idea about Windows Phone.
- skol101 14y agoYep, so you just switch them off completely for Android devices with code like $(document).bind("mobileinit", function () { //apply overrides here if (navigator.userAgent.indexOf("Android") != -1) { $.mobile.defaultPageTransition = 'none'; $.mobile.defaultDialogTransition = 'none'; });
- 54mf 14y agoIn short, the downsides: - You're limited to the number of "native" hooks you have access to, and cross-platform feature parity is iffy. - Can't verify this personally, but I've heard Android and Windows Phone apps can be very slow due to their webview wrappers kind of sucking. iOS is great though. - PhoneGap doesn't offer any sort of native UI elements, so if you want your app to look like a "real" iPhone app you have to build the UI from either CSS, which gets hardware-intensive when you start throwing in tons of gradients and shadows, and is difficult to make look exactly like the native elements - or images, which will look like crap when Apple releases a new higher-resolution device. (Not a huge issue, but there are still a lot of apps with non-Retina graphics.) - Interactive elements (page transitions, glow/shadow/gradient effects, animations) can be very, very slow. There are ways around most of the speed issues - using hardware-accelerated CSS, detecting touch events instead of click events - but it can be hairy. - Fixing bugs is rough. PhoneGap doesn't dump Javascript errors to log like a web browser does, so you'll have to deal with your app randomly not responding for no apparent reason and spending an hour hunting until you find that one typo or missing semicolon. But, the upsides: - Getting from point A to a working prototype takes significantly less time. - Porting to other platforms, while tricky if your app relies heavily on native hooks, is significantly easier than completely rewriting. - Personal opinion, but HTML + CSS + Javascript is just a nicer environment to develop with. - Every new iOS release comes with new features that make developing web apps a lot easier. iOS 5 brought native-style inertial scrolling to overflow: scroll, true fixed elements with position: fixed (though fixed elements still have some quirks), for example. I'd highly recommend giving it a shot. You can be up and running with a working HTML/CSS/JS app in the iPhone Simulator in like 10 minutes. Hard to argue with that.
- Arcticus 14y agoAlthough PhoneGap does not offer any UI elements, there are plenty of mobile optimized UI libraries such as JQuery Mobile and others that replicate a more "native feel". Using a mobile optimized UI library will also dramatically improve the interactive element's and transition's performance. Performance is still a big consideration though as it has more of a good enough versus "native" feel. Regarding the limitation of "native" hooks, PhoneGap has a very solid plugin system which allows your JavaScript code to call native code. There really is no limitation to this. As far as fixing bugs, since you are using web technologies to build your app you can usually debug in the the browser. If you have something that relies on a specific device implementation, then there is WEINRE. Granted its not as powerful as debugging in XCode or Visual Studio but it definitely gets the job done without to many headaches.
- regularfry 14y agoI wanted more control over the camera than phonegap allows, so I jumped to native.