Structuring A Phonegap Jquery Mobile Application
Solution 1:
I have a rather large application and this is how I have it structured
css
-- all css files
images
-- all image files
js
controller.js -- page events and element actions. Also contains PhoneGap specific methods
core
forms.js -- working with forms, saving info
mobile.js -- basic definitions, AJAX communications
encrypt.js -- encryption
global.js -- helper functions
storage.js -- database storage wrapper
cw
client.js -- a client object, > 400 lines of js code
Objects.js -- all other needed objects with <50 lines of js code each
question.js -- a question object, > 500 lines of js code
service.js -- a service object, > 700 lines of js code
jq
jquery-ui.min.js
jquery.min.js
jquery.mobile.min.js
phonegap-1.1.0.js
add_client.html
clients.html
client_list.html
index.html -- the only file that is structured like a real full html file
manager.html
schedule.html
service.html
aside for my index.html file, all other .html files are stubs. They only contain the <div data-role='page'></div>
and other needed html elements that define the page and its intended functionality.
I develop the app on VS2010, using Chrome as my debugger. When I feel good with my progress, I copy everything over to my mac to a folder in an Eclipse project ( for Android devices ) which is also a linked reference in my xCode project ( for iOS devices ).
I have been working on this project for about 3-4 months now and once I got past the learning curve of jQM and PhoneGap, have been making very good progress with this structure.
Solution 2:
Have you seen the wiki entry?
and to see some code have a look @
Sample Application using jQuery Mobile and PhoneGap http://coenraets.org/blog/2011/10/sample-application-with-jquery-mobile-and-phonegap/
Post a Comment for "Structuring A Phonegap Jquery Mobile Application"