News for hackers. Stuff that matters.
Re:PhoneGap 1.6 Released by companyhen on Thursday April 12, 2012 @10:08AM (#3832329)
I just started developing mobile apps with Appcelerator. Any reason I should have gone with PhoneGap? I want to begin building basic data-driven apps for my clients and I like Appcelerator from what I've seen so far.

No experience with Java or Obj-C (I'm a n00b programmer and decent web developer) and wanted to start banging out apps ASAP.

Re:PhoneGap 1.6 Released by dc-tech-fan on Thursday April 12, 2012 @08:53AM (#3832098)
I'm giving Phonegap a try to make the mobile version of http://doodleordie.com. Thoughts/recommendations/inspirational success stories with Phonegap?

Of course Native is better but the Doodle or Die fans want a mobile app now and Phonegap seems like a quick win because I know JS well and I don't know Java or Objective C.

Re:PhoneGap 1.6 Released by gavingmiller on Thursday April 12, 2012 @10:00AM (#3832302)
I've done iOS applications natively and with PhoneGap. The apps that I did with PhoneGap have only been deployed to iOS so there hasn't been a lot of benefit in developing with PhoneGap. I'd say development time was roughly 1:1. If those apps get deployed to other platforms, then it's a huge win.

To get the experience I wanted on PhoneGap I've benefitted from being able to work natively. And I've also needed to develop functionality that didn't exist as plugins, which being able to jump to obj-c helped with too.

Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @09:11AM (#3832144)
I'm writing an application in it at the moment, experimenting with Parse and it's been a great experience. You can use a mixture of both native controls and HTML5, see the NativeControls plugin. I'm using a native UITabBar and the UIWebView for the HTML5 / jQuery (native developers seem be building this way now anyway (FB etc)).
Re:PhoneGap 1.6 Released by cmer on Thursday April 12, 2012 @12:28PM (#3833085)
I just learned about NativeControls today. From what I saw, it only provides Toolbar and TabBar but doesn't do Navigation, for example, am I right?
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @04:58PM (#3834134)
UIActionSheet, UIStatusBar, UIToolBar and UITabBar I think. What are you looking for?
Re:PhoneGap 1.6 Released by cmer on Thursday April 12, 2012 @05:04PM (#3834164)
I'd love to be able to have a web view for the "content" of my app, but native navigation at the top, and native everything else basically.
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @05:29PM (#3834246)
I may have misunderstood, but can't you use the UIWebView (PhoneGap uses this by default for rendering) for HTML5/Cordova assets with the native UIToolBar at the top? (that's what I'm doing, but with UITabBar) Everything else can be done using native UIActionSheets.
Re:PhoneGap 1.6 Released by geoffroy on Thursday April 12, 2012 @10:47AM (#3832516)
What is Parse ? Do you have a URL ? thanks in advance !
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @10:50AM (#3832529)
Re:PhoneGap 1.6 Released by makmanalp on Thursday April 12, 2012 @09:02AM (#3832118)
I'm also interested in this.
Re:PhoneGap 1.6 Released by AshleysBrain on Thursday April 12, 2012 @09:26AM (#3832192)
I wish they'd have better changelogs - look at the first item for iOS: "Updates for Media API". This is kind of important to me. What exactly has been updated? Is it backwards compatible?
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @12:40PM (#3833141)
If 1.6 broke your build and you wish to rollback to 1.5 (temporarily), this worked for me:

  git clone https://github.com/phonegap/phonegap.git
  git checkout -b de1960d5a3 de1960d5a3
Re:PhoneGap 1.6 Released by cmer on Thursday April 12, 2012 @09:24AM (#3832186)
There was a story about iOS local storage being broken in iOS 5.1 yesterday. PhoneGap 1.6 seems to fix this!

"The PhoneGap/Apache Cordova Community has worked hard to fix many bugs (including the nasty local storage bug caused by the iOS 5.1 update) and added some new features."

"Fixed CB-330 – localStorage / SQLDatabase no longer persistent after iOS 5.01 update Fixed CB-347 – iOS 5.1 localStorage / SQLDatabase error after upgrading an app"

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.
Re:PhoneGap 1.6 Released by basicallydan on Thursday April 12, 2012 @10:48AM (#3832518)
I'm finding it hard to figure this one out: does PhoneGap include any built-in Websocket support yet? I've Googled around and found a plugin and a few links indicating that it's going to included with PhoneGap in the future but nothing concrete.
Re:PhoneGap 1.6 Released by tocomment on Thursday April 12, 2012 @09:14AM (#3832159)
Hopefully not too dumb of a question .. can I use phonegap to make an augmented reality app?

If not, do you guys have any advice to get started?

Re:PhoneGap 1.6 Released by 54mf on Thursday April 12, 2012 @10:39AM (#3832475)
Unfortunately, no. You'll need to go a lot deeper to access live camera info, overlay some sort of HUD, and run background processes to process and load necessary data.
Re:PhoneGap 1.6 Released by daleharvey on Thursday April 12, 2012 @09:05AM (#3832129)
wait, is it phonegap or cordova?
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @09:08AM (#3832134)
Cordova, but they're getting there :) The documentation has now been updated, however, you'll still find yourself having to update a lot of the plugins' import statements and if you're looking for resources on SO, or elsewhere, you're better off using "phonegap" as the search term.
Re:PhoneGap 1.6 Released by daleharvey on Thursday April 12, 2012 @09:15AM (#3832163)
Thanks, I thought they had switched the name, but this announcement made me thing the project was called cordova but the product called phonegap still, renaming stuff is hard
Re:PhoneGap 1.6 Released by dawson on Thursday April 12, 2012 @09:28AM (#3832197)
It's complicated, this helps explain (a little) http://phonegap.com/2012/03/19/phonegap-cordova-and-what%E2%...