Playtime with Cordova: pt.3 jQuery Mobile integration
DISCLAIMER: This is me sharing my learning, I have not yet created a final application, and also, some of the process’ below may not be best practice. BUT as a place to start playing, which is really what we all want to do, I think it works.
Just look at the speed we are getting through this, you now have a development environment, and an application template that you are ready (and able) to test with. Next we start with the fun of tweaking it. Now, as with all things web, there are 101 ways of doing this, you could write from scratch, or maybe use one of the new frameworks like backbone/angular/ember. I opted for jQuery mobile though, it is well suited to the job at hand, but more importantly, there is a very small learning curve as I use jQuery at least once a week in regular Drupal development. Note that jQuery mobile may be considered overkill as it can be bloated, once you have built your application, you should always re-download jQuery and jQuery mobile so it only has the functionality you require.
Now, I did some tweaking, and thought I was getting somewhere. But the best place to start is with a little YouTube set of videos by ‘App-O-Mat’, check them out here https://www.youtube.com/watch?v=rW0Trnx7Yjo
To be honest, that will get you started really quite nicely, just go back over pt 2 of this series and see it work. But that said, I am a man who learns through repetition and working things out, so you may want to do the same. Just go and build some new pages and link to them.
Okay, I think I may stop there for this post, if you want some reading before the next part, have a read of this, as we will be doing some dynamic generation of pages soon using data from a csv file (both local, and a remote one).
The main things to take home in there are how the ‘pagebeforechange’ binding is required, aswell as the ‘enhancement’ parts. The enhancements are needed, as it triggers the jQuery mobile functionality to get all the layouts and listeners behaving on your new page as if it was hard coded.
Cultivating a better future, with the seeds of better websites
For several years I have evolved through one of the largest media charities in the UK to the role of Senior developer. I loved it there, but have to stepped out on my own as a freelance developer.
My main skills are with the Drupal CMS, developing code for it, ensuring standards through projects (whether that design, development, or planning), and leading teams to build applications they can be proud of.
Digital Consultancy, Web Development and Project Architecture are where I try to focus my skills, supporting my passion and desire to create stunning websites on time, in budget, and meeting your objectives.
To build a powerful web presence, I combine my creative, technical, and managerial experience (alongside a good splash of passion) which I have cultivated over 10 years in the industry, creating websites people want to shout about.