Should You build Phonegap or Native?
- 09
- Mar
Most start-ups and independent developers run into the same question:
Should I use PhoneGap or native to develop my app?
Short answer
I chose PhoneGap and I’m happy with the results. PhoneGap used to be slow, but v3.0 , released mid 2013, is fast. On modern devices the performance is comparable to native. Final result, Heart Spark Android App it uses gps, maps, camera, storage. Note: You must include FastClick.js in your app, it removes the 300ms delay mobile browsers have built in.
*Exceptions* If you are building a game or anything animation heavy the answer is probably native. If you must support older, weaker devices do some testing before committing.
Full Answer
2 months ago I started work on Heart Spark, an app to gamify the crowdsourcing of defibrillator locations. After a month of trying native development and a month of PhoneGap development I stuck to PhoneGap and was very happy with my choice. Since then I’ve had to do three more app development projects, and both times I’ve gone to PhoneGap.
PhoneGap Features I Used
- Offline maps with Leaflet.js
- GPS tracking (both high and low accuracy)
- Native Camera
- File Storage
- AJAX / Web Communication
- Facebook Connect: (I had trouble getting the Android Release version to work.)
JS Frameworks & Libs Used
- jQuery
- jQuery Mobile: great for mobile friendly UI, but way too heavy; it inflates the DOM 3-4x. If redoing it I would choose Twitter Bootstrap.
- Leaflet.js Mapping Library. You can also use Google Maps, but Leaflet makes offline mapping easier.
- FastClick.js a polyfill for getting rid of the 300ms delay in mobile browsers.
Why Phonegap over Native?
Managing a single code base: If we went native we would have to manage two code bases, iOS and Android. That means every bug fix, every feature added, every change would have to be done twice.
JavaScript is Easier: Getting clean working JavaScript up and running is much easier and faster than Java and especially Objective-C. Most apps are not doing industrial grade real-time calculations and will not suffer from being run on JS. After a month on native development it took us only 4 days to write the same amount of app functionality in JavaScript.
Making it pretty: I spent a month building the native Android version while my partner built the iOS version. It was my first native Android app, so the learning curve was pretty stiff, but I’d done Blackberry and WindowsPhone development before, so it wasn’t too bad. The problem I had was that getting a nice looking UI was not as easy or natural as in PhoneGap. With PhoneGap I just had to find a nice style sheet, drop it in, and I was done!
Costs: Compare trying to hire a new Objective-C developer vs hiring a JS developer. Simple economics, there are way more JS developers out there so you’re going to get much a stronger developer for the same price…or the same developer for a much cheaper price. Also if you need to support both Android and iOS you can have two JavaScript developers work together and help each other out. With native you would have two developers working completely independently.
Example Apps
Apps I developed with PhoneGap, try them out to test PhoneGap performance on your device.
Heart Spark: https://play.google.com/store/apps/details?id=com.smewebsites.heartspark
Hotdogs or Legs: https://play.google.com/store/apps/details?id=com.smewebsites.hotdogs
More PhoneGap Articles
How to setup a PhoneGap 3.4 App in 5 min