Home
Phonegap Setup

- Phonegap is another SDK element that needs to be installed. Altough this setup isn't as straightforward.

  Phonegap is a multi-platform framework that allows you to build native apps with HTML5, CSS and other web standards.

  You can learn more from the offical Phonegap website! "http://www.phonegap.com"

  On the main page click the big orange download button! It should download as a zip, which you should extract as a folder. We will only need the Android folder so you can delete everything else you do not need.

  Create a new Android Project.

  The Project name should be anything you want. Leave everything down to build target as the default. Under build target select "2.2". Under properties the name can be anything, the package name should be com.yourname.example. You also want to create a new activity called App. Although not required the Min SDK version should be 3, for andorid 1.5

  Now right click on your project and make two new folders. One should be called "libs" and the other "assets" Inside the assets folder create another sub-folder called "www".

  Browse to where you download the phonegap file. Drag the phonegap.js to assets/www. Make sure to copy the file not link it. Keep the folder open because you will need to copy phonegap.jar to libs.

  We now need to tell eclipse to recognize the .jar file. Do this by right clikcing on your project>Build Path>Configure Build Path. Then click add JAR on the right, browse to the libs folder and select the phonegap.jar. You many then need to refresh the project with F5.

  We now need to make some changes to the projects main java file.

  First change the class's extend from Activity to DroidGap. Next Replace the setContentView() line with super.loadUrl("file:///android_asset/www/index.html"); Then add import com.phonegap.*;

  All sample code can be downloaded from "http://iamjake648.com/androidsamplecode.txt"

  Open the sample code file and past the permission into the Android Manifest. Also add android:configChanges="orientation|keyboardHidden" to the activity tag in the Android Manifest.

  The final step is to add your HTML files to the assets/www folder. Make sure you main file is named index.html!