News for hackers. Stuff that matters.
Re:PhoneGap 1.6 Released by kanja on Thursday April 12, 2012 @09:20AM (#3832177)
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?
Re:PhoneGap 1.6 Released by 54mf on Thursday April 12, 2012 @10:18AM (#3832366)
In 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.

Re:PhoneGap 1.6 Released by Arcticus on Thursday April 12, 2012 @10:38AM (#3832471)
Although 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.

Re:PhoneGap 1.6 Released by 54mf on Thursday April 12, 2012 @10:46AM (#3832509)
In my personal experience, jQuery Mobile has been incredibly slow (by incredibly, I mean hundreds of milliseconds of delay between touch events and response, which is unacceptable to me) and is kind of ugly. It feels cheap to me. I wouldn't recommend it, but again, personal opinion.

You're right about the plugin system, but that also requires that you know Objective-C if you want to build anything on the other side of that plugin, and if you know Objective-C why are you bothering to build an app with PhoneGap?

Debugging in the browser is a possible solution, but even Mobile Safari's developer tools are very limited. The console displays more JS errors, but often won't include line numbers or other critical details. Plus, no support for any native hooks. Weinre is okay but you're right that it's still not as in-depth as a real browser, and I haven't been able to get it working on an actual device yet, only in the Simulator.

Basically, the whole environment still has that duct-taped-together feel to it. The benefits are still worth it to me, but there's definitely a lot of room for improvement.

Re:PhoneGap 1.6 Released by skol101 on Wednesday April 18, 2012 @11:41AM (#3858473)
Default settings aren't optimal, yes, but try looking around for answers on jQuery forum and Phonegap Google groups, and you'll find useful tips how to make interface more robust.

E.g., for my links I use following code. It binds a tap event (instead of a standard jQuery Mobile click event) to a button/link, resulting in almost no delay.

    $('#footer-menu a').on('tap vmousedown', function () {
        window.location.href = $(this).attr('href');
    });
Re:PhoneGap 1.6 Released by Drbble on Friday April 13, 2012 @02:40AM (#3835641)
Phonegap absolutely sends console messages and exceptions to logcat on Android at least.
Re:PhoneGap 1.6 Released by denysonique on Thursday April 12, 2012 @09:58AM (#3832296)
Personally 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.
Re:PhoneGap 1.6 Released by 54mf on Thursday April 12, 2012 @10:20AM (#3832385)
On 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.
Re:PhoneGap 1.6 Released by eagsalazar on Thursday April 12, 2012 @02:15PM (#3833564)
css 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.
Re:PhoneGap 1.6 Released by skol101 on Wednesday April 18, 2012 @11:43AM (#3858485)
Yep, 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'; });

Re:PhoneGap 1.6 Released by AshleysBrain on Thursday April 12, 2012 @09:22AM (#3832181)
Well, 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!
Re:PhoneGap 1.6 Released by regularfry on Thursday April 12, 2012 @11:13AM (#3832637)
I wanted more control over the camera than phonegap allows, so I jumped to native.