For iOS and Android
Updated December 7, 2012
Recently, we built a mobile app using PhoneGap. One of the better things to come out of it is a skeleton for future mobile app development for iOS and Android projects. We were able to bundle both the Eclipse project and Xcode project files together.
This can be helpful in getting started quickly. Or for keeping your code simply organized. Either way we recommend versioning any work you do and this gives you a place to start.
New – Get the Latest Code
The ZIP file (28MB) including PhoneGap 2.2.0 built with Google API 16
The ZIP file (4.5MB) including PhoneGap 1.7.0 built with Google API 15
Loading in Eclipse
The easiest way is to extract the ZIP file anywhere on your computer and then Import an existing project into your workspace.
Loading in Xcode
You’ll need to download PhoneGap anyways and run the installer.
Just double click on the xcodeproj file in assets/howdyworld.xcodeproj.
How it Works
Takes advantage of the fact that Android doesn’t compile or look for code in its assets folder. The assets folder is where you store the web code. So we can put the Xcode project in the assets folder. This way you can have one root folder sharing common web code for separate devices.
Do it yourself
Create the project first in Xcode. Follow the instructions to setup the project like normal. So now you have an Xcode structure like:
Then you want to create an Android project in Eclipse. Follow the standard procedure. But this time, when it comes to creating the assets/www folder. You’ll call upon the Xcode project. Drop the structure including the /helloworld, /helloworld.xcodeproj, and especially /www into /assets.
I am always happy to hear better ideas. This was fast, quick, and got us running immediately. We really wanted to save someone else a few smidgens of time.
Get Some More