PhoneGap - develop native iPhone applications in HTML/Javascript
PhoneGap is one of the best projects to come out of iPhoneDevCamp II. It seems absolutely perfect for web developers who haven't yet gotten comfortable with writing iPhone applications in Objective-C:
PhoneGap is a free open source development tool and framework that allows web developers to take advantage of the powerful features in the iPhone SDK from HTML and JavaScript. We're trying to make iPhone app development easy and open. For many applications a web application is the way to but in Safari you don't get access to the native iPhone APIs, and the that's the problem we're trying to solve.
It is written in Objective-C and allows developers to embed their web app (HTML, JavaScript, CSS) in Webkit within a native iPhone app. We're big advocates of the Open Web and want JavaScript developers to be able to get access iPhone features such as a spring board icon, background processing, push, geo location, camera, local sqlLite and accelerometers without the burden of learning Objective-C and Cocoa.
Wrapping the WebKit library in a pre-built Cocoa shell enables two big things:
- Web developers can create a native, network-aware application that can be distributed and installed on the iPhone
- The javascript in these applications can access special iPhone features (Ie. location and accellerometer data) that normal web apps cannot
Here's some of the iPhone API that's exposed in Javascript by PhoneGap:
Geo Location
//request location - this triggers a subsequent method call to gotLocation(lat,lon)
getLocation();//GAP will invoke this function once it has the location
function gotLocation(lat,lon){
$('lat').innerHTML = "latitude: " + lat;
$('lon').innerHTML = "longitude: " + lon;
}Accelerometer
//You have instant access to the accellerometer data via the accelX, accelY, and accelZ variables
function updateAccel(){
$('accel').innerHTML = "accel: " + accelX + " " + accelY + " " + accelZ;
setTimeout(updateAccel,100);
}
Of course, this is open source. So in addition to the pre-built functionality, folks who can swing a little bit of Objective C can build on the PhoneGap codebase and provide Javascript access to other embedded features on the device.
PhoneGap [via Ajaxian]
Download PhoneGap at GitHub
Posted by Jason Striegel |
Sep 23, 2008 08:33 PM
Ajax, iPhone |
Permalink
| Comments (0)
Recent Entries
- Google Gadget that monitors Arduino sensor data
- PhoneGap - develop native iPhone applications in HTML/Javascript
- Plotting streaming data in real-time with Gnuplot
- Arduway: LEGO and Arduino make a Segway
- WiFi robot
- Resin casting
- The (unfortunate) iPhone Development Story
- Stanford Engineering Everywhere
- DIY espresso machine
- Zoom H2 line input hack - make a 4 channel field recorder
Bloggers
Welcome to the Hacks Blog!
Categories
- Ajax
- Amazon
- AppleTV
- Astronomy
- Baseball
- BlackBerry
- Blogging
- Body
- Cars
- Cryptography
- Data
- Design
- Education
- Electronics
- Energy
- Events
- Excel
- Excerpts
- Firefox
- Flash
- Flickr
- Flying Things
- Food
- Gaming
- Gmail
- Google Earth
- Google Maps
- Government
- Greasemonkey
- Hacks Series
- Hackszine Podcast
- Halo
- Hardware
- Home
- Home Theater
- iPhone
- iPod
- IRC
- iTunes
- Java
- Kindle
- Knoppix
- Language
- LEGO
- Life
- Lifehacker
- Linux
- Linux Desktop
- Linux Multimedia
- Linux Server
- Mac
- Mapping
- Math
- Microsoft Office
- Mind
- Mind Performance
- Mobile Phones
- Music
- MySpace
- MySQL
- NetFlix
- Network Security
- olpc
- OpenOffice
- Outdoor
- Parenting
- PCs
- PDAs
- Perl
- Philosophy
- Photography
- PHP
- Pleo
- Podcast
- Podcasting
- Productivity
- PSP
- Retro Computing
- Retro Gaming
- Science
- Screencasts
- Security
- Shopping
- Skype
- Smart Home
- Software Engineering
- Sports
- SQL
- Statistics
- Survival
- TiVo
- Transportation
- Travel
- Ubuntu
- Video
- Virtualization
- Visual Studio
- VoIP
- Web
- Web Site Measurement
- Windows
- Windows Server
- Wireless
- Word
- World
- Xbox
- Yahoo!
- YouTube
Archives
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
Recent Posts
- PhoneGap - develop native iPhone applications in HTML/Javascript
- Plotting streaming data in real-time with Gnuplot
- Arduway: LEGO and Arduino make a Segway
- WiFi robot
- Resin casting
- The (unfortunate) iPhone Development Story
- Stanford Engineering Everywhere
- DIY espresso machine
- Zoom H2 line input hack - make a 4 channel field recorder
- SnackUpon
www.flickr.com
|






Leave a comment