

PhoneGap 1.6 Released - JanLaussmann
http://phonegap.com/2012/04/11/phonegap-1-6-released/

======
companyhen
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.

------
dc-tech-fan
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.

~~~
dawson
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)).

~~~
cmer
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?

~~~
dawson
UIActionSheet, UIStatusBar, UIToolBar and UITabBar I think. What are you
looking for?

~~~
cmer
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.

~~~
dawson
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.

------
AshleysBrain
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?

------
dawson
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

------
cmer
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"

------
kanja
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?

~~~
54mf
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.

~~~
Arcticus
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.

~~~
54mf
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.

~~~
skol101
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');
        });

------
basicallydan
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.

------
tocomment
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?

~~~
54mf
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.

------
daleharvey
wait, is it phonegap or cordova?

~~~
dawson
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.

~~~
daleharvey
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

~~~
dawson
It's complicated, this helps explain (a little)
[http://phonegap.com/2012/03/19/phonegap-cordova-and-
what%E2%...](http://phonegap.com/2012/03/19/phonegap-cordova-and-
what%E2%80%99s-in-a-name/)

