Avatar Brit Gardner’s Site

all the code that’s fit to printf()

PhoneGap - Native iPhone Apps Running your HTML, CSS, JavaScript Code

Stumbled across phonegap - a project that allows you to publish a native iPhone app that simply acts as a pass-through to your web application of choice.  The best part is, you can tap into some of the core frameworks of the iphone SDK via javascript, i.e. you can tap into the Core Location framework, Acceleration, etc, etc! Hats off to the developers of this project. It’ll make my life a whole lot easier.

Step 1: Develop a website on the stack of your choice. Better yet, use the iUI library to develop a website that looks and feels like a native iphone app.

Step 2: Download phonegap from github and open the project in Xcode.  Simply edit the file called url.txt in the Resources folder to point to the URL of your iphone app. Compile and run and you should see your website appear.

Step 3: To access the SDK libs, simply use their function calls:

  1.     getLocation();
  2.  
  3.      // automatically calls this callback
  4.      gotLocation(lat,lon) {
  5.           // do awesome stuff with google maps, etc, etc.
  6.      }

Check out more information on their google group.

Viewing 2 Comments

    • ^
    • v
    hey Guru
    if you have successfully deployed your web application on gap can you please help me by giving following answers:

    1-Did you run it after after following any jail breaking procedure...?
    if so then did you follow the procedure defined here http://www.onlamp.com/lpt/a/7281 or something else?
    2- if there is no way to run gap application without taking standard membership from iPhone dev center, then <key>CFBundleSignature</key>
    is the place where should i place something received after standard membership? if not then whats the purpose of this key in info.plist file?
    3- should we replace the values in string ${EXECUTABLE_NAME} and ${PRODUCT_NAME}?
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    or will these be replaced at runtime? if not then what are the appropriate values should we replace?
    4-3- According to iPhone Environment all applications should be copied in iPhone Applications directory with the .app extension
    SpringBoard automatically recognizes the application on its restart.
    i downloaded the code and it comes with sintaxi-gap-2e59c387b42cb3878596479870679191be6a14e4 name.
    Can i rename it or is there any constraint i can't change the name or should only add the .app extension like sintaxi-gap-2e59c387b42cb3878596479870679191be6a14e4.app?

    thanks in advance for you help
    cheers
    • ^
    • v
    Unfortunately I am still waiting on approval to the dev program so I
    cannot help there. And no I did not do any jailbreaking on this
    iPhone. Try asking dirk on the phonegap google group - he is very
    near to publishing the first phonegap app!
close Reblog this comment
blog comments powered by Disqus

Passion Projects