Mark Kirby - mobile, cloud and IoT

PhoneGap resources and hints

Here are the key resources and some main points from the PhoneGap talk I gave at Async today.

What is PhoneGap?

  • PhoneGap lets you easily package apps for a range of devices and distribute them on app stores using HTML, CSS and JS
  • You can still publish apps using HTML, CSS and JS for any of the platforms without PhoneGap, it just saves you time
  • PhoneGap provides you with JavaScript APIs which talk to device APIs including geolocation, contacts, notifications, accelerometer and more

Device APIs

The install process

  • Download PhoneGap from here, or using github
  • Installation is different for every platform, follow the instructions here - http://www.phonegap.com/start and check the readme notes within PhoneGap folders
  • Installation is neither easy nor straightforward, but once achieved you will find it simple to create new apps and test them using emulators, especially for the iOs apps. An alternative on its way is the [PhoneGap Build][3] solution where you upload apps and get back packaged installers for the various devices. I predict this will cause problems in the long term as it will delay time to publish, slow down testing and make it harder to use the emulators.

Hints and tips

  • Minimise use of JavaScript especially frameworks, even jQuery can slow down the loading times. Consider using http://xuijs.com/ instead
  • Don’t make too much happen at onDeviceReady
  • Optimise all your code if you suffer any issues, check out http://jsperf.com
  • Apps should look native if possible, and differ between platforms unless you have the skills to create a stunning custom UI
  • Ensure the CSS differs between devices, or you use flexible layouts
  • Test on actual devices, emulators aren’t reliable, and test on every device you want to launch on, or at least an older model and a newer

When to use PhoneGap

  • When device APIs aren’t key
  • To get an idea quickly to market
  • When creating a simple app such as interfacing with a web API
  • To save time and money when performance might not be key

Alternatives

[3]: http://build.phonegap.com

comments powered by Disqus