HTML5 Zone is brought to you in partnership with:

Andrew Trice is a Technical Evangelist with Adobe Systems. Andrew brings to the table over a decade of experience designing, implementing, and delivering rich applications for the web, desktop, and mobile devices. Andrew is an experienced architect, team leader, accomplished speaker, and published author, specializing in immersive experiences, mobile development, realtime data systems, and data visualization. Andrew is a DZone MVB and is not an employee of DZone and has posted 53 posts at DZone. You can read more from them at their website. View Full User Profile

Introducing "Walkable" – A New Sample App for PhoneGap

10.03.2012
| 7569 views |
  • submit to reddit

I’d like to take a moment and introduce “Walkable Restaurants” (or just “Walkable” as I like to call it), a new application that I built to demonstrate how to create PhoneGap applications using Backbone.js.

Walkable Restaurants provides you with an easy way to find a bite to eat or refreshing drink anywhere in the US. Either select a type of cuisine, or enter a search phrase, and the Walkable Restaurants app will find destinations that are nearby.  Only destinations near your current location will be returned in your search result. If we are able to calculate travel times based upon walking and train schedules, then we will only return destinations within a 20-minute walk. If we are not able to calculate walk time, only destinations within 2.5 miles of your current location will be displayed.

Walkable Restaurants is available today for FREE in both Apple’s App Store and on Google Play, so go download it now!

        Get it on Google Play

Code Organization

The code for this application uses Backbone.js for client-side JavaScript Model-View-Controller patterns. Backbone.js provides separation of concerns (discrete, reusable classes, with separation of view logic from application logic). However, in this example I am not using Backbone’s data binding features – these enable your views to auto-update when your data changes.

Backbone is built on top of Underscore.js, and leverages Underscore’s templating engine to separate HTML string concatenation from application logic.

Open Source

The Walkable Restaurants application source code is freely available and open source on GitHub at: https://github.com/triceam/Walkable-App

Application source code is intended to be used as a learning tool for building PhoneGap applications using backbone.js, but there are no limitations on its use following the MIT license.

Open source libraries used in this app include:

Data Services

All walking/travel time distance calculations are obtained through Travel Time, by Igeolise. This service calcualtes travel time between geographic locations based upon walking, driving, and mass transit systems.

All point-of-interest (POI) information is obtained through services provided by factual.com. This application uses the U.S. Restaurants data set, which provides information for over 800,000 restaurants across the United States, including location, price ratings, cuisine, and more.

The server-side portion of this application simply aggregates data from Factual and Travel Time, and is developed with node.js, using the expressjs framework.

Also, I almost forgot – Many thanks to Tony Weeg of Revolution Web Design, who I used as a sounding board for UI design & layout ideas for this app!

 

 

Published at DZone with permission of Andrew Trice, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)