If you started with PhoneGap recently or plan to do it in the future, let me give you some advice. This blog post will protect you from losing too much nerve while working with PhoneGap.
I am working on projects that use PhoneGap for one year. I gathered some helpful tips for you.
##Don’t do Windows Phone##
With your (probably) WebKit optimized app you will definitely run into a lot of problems. The best thing for you would be to only develop for Android and iOS.
##Damn, use the PhoneGap CLI##
With PhoneGap 3.x a new node.js based command line interface (CLI) was introduced to make the development process much simpler. You could avoid the CLI most of the time. Just create the platform builds for your app once and delete all the redundant junk afterwards. It would work like in the old days.
But, you really have to use it. PhoneGap’s release cycle is very tight. Updating your app to a new version of PhoneGap with the CLI makes it much easier. With this tool you can also build multiple platforms of your app simultaneously and do some other neat things.
Please spend some time learning how to work with it. It isn’t that hard to understand and you will thank me for it at some point. More about the CLI on the PhoneGap website.
##Optimize, optimze, optimize##
I also experienced some major improvements by getting rid of jQuery in one of my Chrome plugins. This idea is only for the hardcore people, but if you need every millisecond, then don’t use jQuery.
##Keep your app simple##
Mobile phones don’t have strong video cards. So there are problems with full screen UI updates, filters, shadows and transparency. The more you use it, the more laggy your app will be.
jQuery mobile is not intended for PhoneGap apps, but if you have to use it, don’t use another framework next to it. Keep the overhead as low as possible (there is a builder for jQuery mobile). And please take a look on the documentation before diving straight in. This framework is badly documented and most of the time you will looking for answers directly in the jQuery mobile source code.
##Don’t pretend to be native##
To sum it up:
- Only develop for Android and iOS.
- Use the official CLI tools.
- Optimize your app to save memory.
- It is totally fine to don’t look and feel native.