Safari Mobile

  • Published on
    15-Jan-2015

  • View
    3.944

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Transcript

<ul><li> 1. Introduction toMobile Safari Alberto, Gilles and Marc </li></ul> <p> 2. Mobile Safari24/10/2009Content- Introduction - Mobile Safari- GIS- Client-side storage - Demowww.antistatique.net 2 3. Mobile Safari24/10/2009Introduction- About us - Web guru - iPhone fans - Symfony frameworkwww.antistatique.net3 4. Mobile Safari24/10/2009Mobile Safari - CSS (animations) - Geolocalisation support (OS 3.x) - Client-Side Storage (OS 2.1) www.antistatique.net 4 5. Mobile Safari24/10/2009Geolocalisation navigator.geolocation.getCurrentPosition( successCallback, errorCallback, option ) www.antistatique.net5 6. navigator.geolocation.getCurrentPosition(function(pos){ var lat = pos.coords.latitude; var lng = pos.coords.longitude;},function(error){ switch(error.code){ /*[...]*/ }},{ enableHighAccuracy: true, timeout: 45000, // in millisecond maximumAge: 60000}; ); 7. Mobile Safari24/10/2009Client-side storage - 5 Mb - SQLitewww.antistatique.net 7 8. //// OPEN LOCAL DATABASE var db; if (window.openDatabase)db = openDatabase("as_note", "1.0", "AS Note", 200000); //// DO A SELECT db.transaction(function(tx) { tx.executeSql("SELECT id, note FROM MyTable WHERE id = ?", [27], function(tx, rs) {for (var i = 0; i &lt; rs.rows.length; ++i) {/* ... */renderNote(rs.rows.item(i));} }, function(tx, error) { /* ... */ }); }); 9. //// CREATE TABLE IF NOT EXISTS function init() { db.transaction(function(tx) { tx.executeSql("SELECT COUNT(*) FROM MyTable", [], function(result) { doSomething(); }, function(tx, error) { tx.executeSql("CREATE TABLE MyTable (id INTEGER PRIMARY KEY,note TEXT,timestamp REAL)", [], function(rs){ doSomething(); }); }); }); } 10. Mobile Safari24/10/2009Little web app- Write notes - Localize them - Do it offline - Take your iPhone : http://note.antistatique.netwww.antistatique.net10 11. Mobile Safari24/10/2009Further development - Account system - Server synchronisationwww.antistatique.net 17 12. Mobile Safari24/10/2009Benefits of webApps - Easy to develop, update - No install required - Apple free ~ www.antistatique.net18 13. Mobile Safari24/10/2009Backwards - Interactions with native apps - Animation - More www.antistatique.net19 14. Mobile Safari24/10/2009Sources - http://developer.apple.com/- Safari and iPhone - http://dev.w3.org/geo/api/spec-source.html- Geolocation API Specification - http://www.w3.org/TR/offline-webapps/- Offline Web Applications - http://www.jqtouch.com/- plugin for mobile web development on the iPhone,Android, Palm Prewww.antistatique.net20 </p>