As someone working on a phonegap project, I'd really advise against committing to this framework for mobile app development. It is good for really quick and dirty proof of concept things for devices, but for fully fledged mobile apps on iOS and android, there is an enormous gap in terms of performance. In order to get performance at least on par with native, you'd have to sacrifice TONS in terms of user experience.
Want gestures? You'll have to look towards things like iScroll and hammer.js, which work "sometimes". Add that to framework issues, and momentum based scrolling that you will have to implement yourself numerous times... Oh boy. Basically, things that come out of the box on native will have to be manually implemented by yourself, and none of these solutions will even come close to native experiences.
Add this to the fact that phonegap documentation is all over the place, and all you will get are senseless headaches. Save yourself the frustration of hacking the web into a mobile device and go native all the way. You will thank your self later.
I'm supposing you didn't look at what Famo.us offers, in terms of gestures and scrolling. I used to have your opinion, then I actually tried famo.us, and realized how simple it made everything.
I'm arguing that if myself, as a no-design-talent, been using PG since 0.8 guy can recognize the benefits of switching my workflow to this, it is at least worth a look.
Just spending 5 minutes with PhoneGap was enough to convince me that it isn't ready for professional app development, performance wise. That was 2 years ago and I'd hoped it had improved quite a bit since then.
The thing is, the web will never ever catch up to native. The web is too fragmented, has too many libraries, differing philosophies and paradigms, and is too far removed from the hardware to even compete. You think you'll ever see something like Flipboard built on Phonegap? Pretty unlikely.
Hey guys, I work at Famo.us and we've recreated the Flipboard flipping interaction in Famo.us as an internal demo and wrapped it in Cordova with great success. I'll look into publishing this as a demo or making it public.
The thing is that the web doesn't need to catch up to native. The web just needs to satisfy the definition of "quality" held by the majority of users, where "quality" is defined as "fitness for use".
It's not only possible, but almost certain that the web will achieve acceptable performance for 99% of use cases in the next 1-2 years. After that, the web ends up with greater "fitness for use", since they can be ephemeral (instant, on-demand, no installation required), which native apps cannot do.
The only place where native is likely to hold out for the long term is 3D head mounted displays like the Oculus Rift.
There's a big argument against doing something like that in PhoneGap. Phonegap/JS does not have (low-overhead, easy to use) multithreading. I can guarantee you that something like Flipboard is loading/marshalling all the content and data in a background queue of some sort. Maybe even doing some background rendering.
It bears noting that running background tasks in iOS is extremely easy for developers.
I bet a Flipboard-clone wouldn't be too difficult for a few engineers to bang out in Famo.us. But then again, the value of Flipboard isn't in being a beacon of iOS beauty and functionality, but instead lies in the apps wonderfully-curated content.
It's not currently possible today (Web Workers are high-overhead and quite limited) and I haven't seen it in any of the standards for browsers that will be implemented for the foreseeable future. Are there any solutions you can think of?
Keep in mind that the performance here is that of mobile WebView components, not PhoneGap particularly. Mainly PG just creates a shell app that creates a WebView and then runs your content in it. So whether your content would perform better today than two years ago is a matter of whether iOS and Android have improved their WebViews[0]. PhoneGap, for its part, has added more platforms and gotten a much improved extension system in the last two years, but nothing I know of that would seriously affect performance.
[0] Android WebViews seem to improve steadily, while always lagging a bit behind the real browser. iOS WebViews were crappy for a long time, particularly because Apple kept Nitro for themselves while third-party hybrid apps used a way slower JS engine. But iOS 8 apparently made massive strides here, and WebViews are right on par with mobile Safari (Nitro, WebGL, etc). Or so they say; I haven't tried it out yet.
PhoneGap can only do so much, it is mostly just wrapping your HTML/JS/CSS. Finally those languages are starting to get close to what a native app can do (with significantly less development time, perfect for prototyping).
The company I used to work for had some success building a phone gap app as a proof of concept (where internal team members could iterate quickly) getting some traction and uptake, and then having it rewritten in native code by a fairly inexpensive offshore team. More here: http://geekestateblog.com/rewriting-internal-hybrid-mobile-a...
This is the perfect approach to take! While I think the future of Famo.us + Phonegap is super bright, at the moment you're definitely better served using something like this to prototype (while still looking good) and validate, and then potentially go Java/Objc if you need every last drop of performance.
I've been working on putting my PhoneGap/Famo.us knowledge into a consumable form. I hope this "playbook" (with the sample apps and examples) can be useful some folks who are building apps! It is still a WIP on both the copy and code ends, but I'll be adding improvements consistently.
Thank you very much for writing this, I will pay for the book when it comes out (assuming you provide a way to do so) even if you give it all away for free...
This kind of step-by-step start to finish guide is exactly the kind of resource I find the most useful when I want to learn new things..
(one of the Ionic creators here). The focus right now is definitely different for us vs famo.us. We are focusing on building tools for the future of web standards instead of eschewing it for a custom solution. I just don't think that's going to be the right approach in the future (see Flash). I also think requiring a 3D development background to build 2D apps is unnecessary (unless you are building 3D games or apps, then go for it!)
I think the community agrees. Collectively they've started hundreds of thousands of apps this year and are installing our SDK at a rapidly growing rate. One of the benefits they see is a small learning curve, much closer parity with their existing web code, ability to have designers or non JS hackers contribute, and access to tons of existing resources for Angular development.
I normally hesitate to respond like this, but this comment is pure unadulterated self-promotion and FUD that does not belong on HN.
(1) The web standards that you speak of are currently as much a standard as what we are doing at Famo.us. Web Components, as they exist today and as is being promoted by/using Angular/Polymer/Material, is merely an idea in the guise of a standard. Google is the only one really promoting it as such and they got a lot of flak early this year from the Safari and Opera teams over their intent to ship the feature half baked and without consensus support from the other browser makers [0]. Until at least two major browser makers fully implement something and properly document it, it's not a web standard.
(2) There is no requirement to know about 3D development unless you plan on incorporating 3D effects into your app. All the 2D math/development we know and love today is merely an elevation view into a 3D world. You can use famo.us using all your 2D experience without ever really needing to understand 3D math/development. Furthermore, many of the interfaces widgets already available in famous and being created by the famo.us community are sufficiently high-level that the API should be enough to manipulate/modify that widget without any 3D knowledge. Only if you want to be a creator of 3D widgets or design higher order 3D compositions do you have to learn 3D development. Most developers will use famo.us the same way they use the web today (at least for now). i.e. 2D with occasional "Z-index" manipulations. Eventually some will explore what they can do with 3D since it's available [1]. Famo.us always leaves that option open unlike pretty much all other frameworks.
(3) I don't think the community agrees on anything just yet. If you look at the numbers, there are a lot of ideas out there with varying degrees of traction. Things could really not be more fragmented. It's going to be a long time before any framework is declared a winner in this area (if any). Even if a framework is ahead today, history is littered with frameworks that have fallen out of favor like prototype.js, script.aculo.us, YUI and MooTools. Any real student of computing history will be wise to remember Brooks: "No silver bullet"[2]
My suggestion to the OP is to install both and try them out to see how they are different.
(creator here). It definitely sucked on Android in the beginning, and that's on us. Some of the things we were doing on Android were subtly killing performance. But we spent a ton of time focusing on Android and fixing that, so I hope you'll take another look!
Kind of sad the state PhoneGap push support is in. I checked the links and they have an if else for two completely different code branches for Android or iOS and don't support anything else:
http://www.practicalguidetomobileapps.com/resources/book/ful...
Ideally you would support more platforms and not have to make any distinction in the JavaScript and could have a single code path. Right now I pay Pushwhoosh a hefty fee per month for exactly that.
I hate working with closed source stuff that I can't bug fix and improve myself. Just the current state as evidenced by this guide is so far behind commercial offerings it would take months just to get it even comparable.
I totally agree with the sentiment, and iOS/Android support only is unfortunate at the moment. It's only getting better though, and in a few months the improvements in Famo.us/PhoneGap will be impressive.
Just downloaded the book! Thanks for making it free. You are very generous!
I am looking to build a quick and dirty prototype for Tinder for X, and this is a great starting point for me. Thanks Nick!
for such a small app I imagine, that the performance issue is from the tech stack itself vs anything he's coded. I would put that as a warning to those that are considering to using this stack. If it is within the code itself, he shouldn't be teaching bad code.
Thanks! It definitely doesn't have a team of designers/developers behind it...which is kind of the point. If you added a competent designer, and more than a week of work, you can see how a functional, smooth app could result. Not a guarantee of course, but the foundation is there.
Thanks for the feedback! Did you see a different button? (+ new app) perhaps? I updated the url to use the git:// one. I'll have to look into the 20mb limit, I never noticed!
Does anyone know if there is a PG like tool which will help me make an app for camping/hiking routes? As in it's mostly a map, with some filters and it finds nearby locations.
Been looking around but it goes from "learn to code' straight to 'map technology' to 'map access api' which combines to be pretty darn hard.
There are some examples of how to draw routes, markers etc on maps using google maps API at https://developers.google.com/maps/documentation/javascript/... and similar. Once you get it working on a webpage it's fairly simple to convert to an app using Phonegap. I made an app that way for finding bars open - kinda works ok. ('late bars london')
I don't know if pg has changed significantly, but good maps were very hard to do when I looked at them seriously 2 years ago. Few a map centric app, JavaScript maps just don't cut it in production, an native plugins just weren't available for Android.
Come on people, HTML5 is winning! Another awesome and seemingly overlooked option here is ludei.com with their Cocoon platform, launcher and cloud build service. Put that together with React/Flux and some soon to be released Famous-React for flavour and its all possible. Then top it off with Webpack and your laughing.
This looks great! I've been wanting to get into mobile dev but stuck between choosing one of C#, Java, or Objective-C. I work with Javascript every day so this should be more familiar.
If you're doing games (or apps that don't require native UI), I strongly recommend HaXe/OpenFL (http://www.openfl.org/) for crossplatform+native. It's what I used for Lightbot (http://light-bot.com/) and a few other games. Best Game of the Year Winner (according to multiple sources) "Papers Please" was also built on it.
Again, its native UI support is lacking (ie Keyboard, Input Textfield interactions) but otherwise the framework is opensource, solid, and compiles to native from HaXe (based on a similar structure as Actionscript 3) including to Windows, Mac, iOS, Android, Flash, HTML5+WebGL and more.
For each native platform, there actually aren't many (viable) choices. Android has Android (framework) and Java. iOS has iOS (framework), and a choice between two very similar and interoperable languages, Objective-C and Swift.
If you decide to go HTML5 cross-platform you have Phonegap vs. other web wrappers (wrappers); Ionic, Famo.us, Sencha, hand-rolling-your-own (frameworks); and finally just JavaScript (language).
This is ignoring other cross-platform things like Xamarin (which consists of Xamarin the framework, C#, and still also the iOS or Android frameworks, depending on your targets), Titanium, etc.
It's very difficult to get webviews to be as performant and "right feeling" as native.
That said, I think the case is very overstated, and that majority of users (i.e., not 20-somethings from Silicon Valley) won't notice or care if your app has some rough edges.
I've been working on a mobile webapp, and I'm happy with the trade offs - it's cross-platform, and it's "good enough".
I suspect that the majority of people, meaning those who aren't 20-somethings in Silicon Valley, can feel that something isn't right in non-native apps; they just can't articulate what or why. It might actually be more frustrating for them, since they don't understand what's going on, and it just contributes to their general frustration with the all-around crappy state of software.
Because you're going to be implementing the UI twice anyway unless you generate a completely custom one that sits between platforms. As an example, look at the linked article - can you imagine an average iDevice user instinctively knowing how to interact with that UI? There's probably nothing wrong with it per-se, but you've instantly alienated a significant non-technical audience by going off-piste with your cross-platform design.
1. Payscale for native development is higher
2. Your product will look infinitely better. It can do more things that Phonegap can't.
3. Supporting future devices using Phonegap will be difficult. Apple TV SDK? What about the watch thing that could also come out?
4. Xcode is great.
Want gestures? You'll have to look towards things like iScroll and hammer.js, which work "sometimes". Add that to framework issues, and momentum based scrolling that you will have to implement yourself numerous times... Oh boy. Basically, things that come out of the box on native will have to be manually implemented by yourself, and none of these solutions will even come close to native experiences.
Add this to the fact that phonegap documentation is all over the place, and all you will get are senseless headaches. Save yourself the frustration of hacking the web into a mobile device and go native all the way. You will thank your self later.