See it in GitHub
I decided to open source this project in order to provide to you, developers, a production-ready simple Cordova application so that you can boost your development.
This Cordova boilerplate is an extremely simple Cordova app that can be used as boilerplate for apps developed with modularity and performance in mind.
The proposed boilerplate has been developed with MODULARITY and PERFORMANCE in mind, it should be totally memory leaks free and ready-to-be-used in production.
As a reference, give a look at the main.js file in www/js/main.js, it contains:
- configuration map for keeping all the used libraries organized and easily interchangeable
- a close method for closing each view and managing all its inner views and bound events
- a changePage method for the Backbone Router that manages to switch between mobile app pages in a generic and reusable manner
- generic function to show a web page within a Cordova application and checking if the user has an Internet connection
- other useful functions are spread within the boilerplate, such as mobile-friendly CSS3 stylesheet, organization of the project in semantic directories (like: templates, js, img), etc.
Please, if you find some bugs or aspects to be enhanced, drop be a line!
- Handlebars 1.2.0: a minimal templating engine based on Mustache
The web app is purposefully super-simple, it shows a structural view containing the two basic views (it is supposed to be used as navigation hub). Then, the first view contains a string that can be filled dynamically by the Backbone model behind it, and the second view shows a Leaflet map centered on L’Aquila, the city I currently live in.
See it in GitHub