Developing Mobile HTML5 Apps with Grails

5,316 views
5,005 views

Published on

Published in: Technology

Developing Mobile HTML5 Apps with Grails

  1. 1. Building Mobile Web Apps with Grails Sébastien Blanc Sopra Group
  2. 2. About me•34 years old, 2 children•50% french 50% dutch 100% geek Text•Software engineer working for Sopra Group•Follow me on twitter @sebi2706 2
  3. 3. What is a Mobile Web App ? 4 3
  4. 4. Size matters .... 4
  5. 5. Surviving offline 5
  6. 6. CACHE: Cache Manifest File :/css/screen.css/css/offline.css • Simple text file/js/screen.js • Served as text/cache-/img/logo.png manifestFALLBACK: • Declared inside the <html> tagoffline.htmllocalStorage.setitem("myKey","My value"); LocalStorage :localStorage.setitem("myKey", • Simple key/value storage"{my json structure"); • Simple APIlocalStorage.getitem[myKey] 6
  7. 7. 7
  8. 8. 9 8
  9. 9. Geolocation if(navigator.geolocation){ navigator.geolocation.getCurrentPosition( function(position){ var latitude = position.coords.latitude; var longitude = position.coords.longitude; var altitude = position.coords.altitude; } ); } 9
  10. 10. ? 11 10
  11. 11. 11
  12. 12. • Official jQuery Product• Progressive Enhancement• Strong Community• Stable releases 12
  13. 13. jQuery Mobile syntax <html> <body> <div data-role="page"> <div data-role="header"> <h1>Single page</h1> </div> <div data-role="content"> <p>This is a single page boilerplate template that you can copy to build your first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.</p> </div> <div data-role="footer"> <h4>Footer content</h4> </div> </div> </body> </html> 13
  14. 14. Grails & Mobile Web Apps★Grails is a Web Framework★Resource handling★Cache handling★Dedicated plugins★Deploy to the cloud in seconds 14
  15. 15. What’s next ?jQuery Mobile Client Scaffolding plugin : generates a complete independent HTML5 appPhonegap Build plugin : get the native packages in one click ! 15
  16. 16. Searching for the holy Grail 16

×