Monday, May 23, 2011

Starting a Project with Phonegap in Eclipse

Recently, a colleague was asking for assistance setting up a development environment.  The good news is that there are a number of tutorials that go in to detail about how to get started.  The bad news (which is good news too) is that because PhoneGap is advancing rapidly and gaining developer mind-share, these tutorials are getting outdated quickly.For the record, the one that I recommend at the moment is located at: http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart.  This howto doesn't require developers to set up git and ruby, and works with the latest build of PhoneGap.


Walking my colleague through these steps, it occurred to me that it would be much easier if someone created an Eclipse Plugin.    The good news is that someone did.  The installation is, with a minor exception, pretty straight forward.  

  1. Under the Help menu in Eclipse Helios,select "install new software"
  2. Enter the address:  https://svn.codespot.com/a/eclipselabs.org/mobile-web-development-with-phonegap/tags/r1.2/download in the Work With combo and click add.
  3. Give it a meaningful name such as MDS PhoneGap for Android Plug-In
  4. Here's where I ran into an issue.  The plug-in wants to install the JavaScript Development Tools (JSDT) and it was failing to install.  Unclicking this particular component allowed the installation to complete.

After completing the installation, you'll be able to start a new PhoneGap project by selecting File->New->Other->PhoneGap for Android Project.  The wizard allows you to specify local, web, internal, or git repository locations for the PhoneGap bits.  As a bonus, you can also opt to include the JQueryMobile or Sencha Touch in the project and build the sample application.  It's never been easier to get started with mobile development.

No comments:

Post a Comment