Now that everything has been downloaded and installed, it’s time to create a PhoneGap project in Eclipse that’s ready for testing on the Android emulator or on a real Android device:
Start Eclipse and select File→New→Project.
Select Android Project from the New Project dialog.
In the New Android Project dialog, enter the details as shown in Figure 10-4. Your default location will be the same as your Eclipse workspace, but you can change this if desired. Choose an Android version that is compatible with one of your virtual Android devices or a real Android device. The package name follows the usual Java rules of package naming—typically, a reverse domain name that is guaranteed unique so it does not conflict with other Java packages.
Go to the root directory of the project and create two new directories: /libs and /assets/www. (Note that the assets directory already exists.)
Copy phonegap.js from the Android directory in the extracted PhoneGap directory to /assets/www.
Copy phonegap.jar from the Android directory in the extracted PhoneGap directory to /libs.
After you’ve created the two directories and copied phonegap.jar and phonegap.js, the project in Eclipse should be structured within the Package Explorer as shown in Figure 10-5.
Figure 10-4. The New Android Project dialog
Figure 10-5. Project layout in Eclipse