Gtug2 Mobile app with web technlogy

28
Principes de dév web d’applications mobile JqueryMobile et GWTMobile essais et retours d’expérience Montréal #2 @gtugmontreal https://groups.google.com/group/gtug-montreal Sacha Leprêtre 14 Septembre 2011

Transcript of Gtug2 Mobile app with web technlogy

Page 1: Gtug2 Mobile app with web technlogy

Principes de dév web d’applications mobileJqueryMobile et GWTMobile

essais et retours d’expérience

Montréal #2

@gtugmontrealhttps://groups.google.com/group/gtug-montreal

Sacha Leprêtre14 Septembre 2011

Page 2: Gtug2 Mobile app with web technlogy

Stratégies de développements

– Pur natif (sdk android)• Avec SDK

• Avec NDK

– Pur web (dans le navigateur)

– App locale sans navigateur mais web

– Autres:• Combinaisons possibles…, mécanisme d’extensions

• Meta langages…

Page 3: Gtug2 Mobile app with web technlogy

Possibilités

App natif

App web

Extensions

Page 4: Gtug2 Mobile app with web technlogy

Webkit ?

– Webkit ?

– HTML5 ?

– Webview ?

ARMDalvikVM

WebkitHTMLJSCSS

Page 5: Gtug2 Mobile app with web technlogy

Outils de développement

– Eclipse • (svn, androidsdk…)

– Chrome• Inspection de DOM

• Debug js

• WebSQL

• Extension chrome: Window resizer

– Lita (SQLLite client)

– LA TABLETTE ou le smartphone! Pas l’émulateur…

– ADB• Console.log

• SQL

– App: Astro filemanager

Page 6: Gtug2 Mobile app with web technlogy

Pile technologique présentées

– Application• Webview: Phonegap

– Language• Javascript: (pur, Jquery…) ou Java->Javascript (GWT)

– Layout• HTML,CSS,Javascript: JqueryMobile, GWTMobile

– Stockage• HTML5 websql: persistencejs

• Fichier: Phonegap

Page 7: Gtug2 Mobile app with web technlogy

Dev dans le navigateur CHROME

Page 8: Gtug2 Mobile app with web technlogy

Phonegap

Page 9: Gtug2 Mobile app with web technlogy

Phonegap• Eclipse, Installer Android SDK et Android Eclipse

Plugin• Faire un projet Android• Déposer phonegap.js et librairie phonegap.jar

Page 10: Gtug2 Mobile app with web technlogy

Parlons de stockage(offline)

Page 11: Gtug2 Mobile app with web technlogy

Persistence.js

– http://persistencejs.org/

– ORM

– pas d’écriture de SQL !

– Couche d abstraction extensible selon l’évolution de la norme HTML5:

• WEBSQL

• LocalStorage

• IndexedDB

Page 12: Gtug2 Mobile app with web technlogy

Persistence.js

éfinition des entités:

•ptimiser (index et dénormalization)

•mettre en relation

Persistence.js

Page 13: Gtug2 Mobile app with web technlogy

Persistence.js

equêtes !

Page 14: Gtug2 Mobile app with web technlogy

og SQL pour webSQL !

HROME ! Ou FF

Persistence.js

Page 15: Gtug2 Mobile app with web technlogy

SQLLite client permet d’acceder à la BD de CHROME !

LITA

HTML5 storage !

Page 16: Gtug2 Mobile app with web technlogy

Parlons de JqueryMobile

Page 17: Gtug2 Mobile app with web technlogy

JqueryMobile

– http://jquerymobile.com/demos/1.0a4.1/

– Un language visuel pour l’utilisateur

Page 18: Gtug2 Mobile app with web technlogy

JqueryMobile: Principes

Votre code : Page html-Balise HTML-Balises JQM

Page html enrichie (DOM mémoire)

ProcesseurJquery.js+JQM.js

Page 19: Gtug2 Mobile app with web technlogy

Parlons de GWTMobile

Page 20: Gtug2 Mobile app with web technlogy

Intérêts

• GWT• Mobile• Application

• et… architecture

Page 21: Gtug2 Mobile app with web technlogy

GWT Mobile UI: les widgetsUn langage visuel

• Webkit (Android,IOS,Chrome,Safari…)• Un langage visuel pour l’utilisateur

• Démo: http://www.ambigtion.com/gwtmobileui/

• Approches visuelles similaires :– Jquerymobile.com alpha 4– Dojomobile

• Forces/faiblesses de GWT Mobile UI ?

Page 22: Gtug2 Mobile app with web technlogy

Code: env

• Env– Eclipse + GWT Eclipse plugin– GWT Mobile UI– Lancement de Kitchensink (palette de

widgets)

Page 23: Gtug2 Mobile app with web technlogy

Code: Principes et architecture

Page 24: Gtug2 Mobile app with web technlogy

Code: Principes et architecture• Mécanisme de « Page » ;-) :

– Faire la vue UIbinder de la Page:• MainPage.ui.xml • Rapide avec le GWT dev mode !

Page 25: Gtug2 Mobile app with web technlogy

Code: Principes et architecture• Mécanisme de « Page »

;-) :– Désigner la logique

associé à la page:• MainPage.java: Étendre

Page• MainPage.java: Définir

logique suivante et routage…goto(…)

• Back géré

Page 26: Gtug2 Mobile app with web technlogy

Code: Principes et architecture• Mécanisme de « Page »

;-) :– Autres pages…– Page est un concept– Non MVP– Principe d’architecture

simple

Page 27: Gtug2 Mobile app with web technlogy

GWT Mobile phonegap• Un wrapper javascript de phonegap• Phonegap ?

Page 28: Gtug2 Mobile app with web technlogy

Quoi d’autre…

• Dev nouveau( jan 2011)• Message de Denis: « Hi GTUG Montreal, GWT Mobile welcomes their

participation in the open source project !»• ROADMAP From Denis:

– 1. Complete the initial release of the gwtmobile-ui project. That includes finishing up a basic set of UI widgets and laying down the fundation for the theming function.

– 2. Upgrade the gwtmobile-phonegap project to support 0.9.4, the current phonegap version.

– 3. Enhance the gwtmobile-persistence project to support GWT Request Factory so that the same domain classes can be used on both the client and the server sides.

– 4. Alternative or in additional to #3, enhance gwtmobile-persistence to work with the resty-gwt project, for people who perfer JSON in communicating with the server.

– 5. Support WP7 later this year when the WP7 mobile browser is upgraded to IE9.– 6. Support tablet form factor. May utilize the GWT MVP Framework for this purpose if

it makes sense to do so.– 7. Make gwtmobile-ui work with the GWT UI Designer in designing UI for mobile

devices. This is actually a long term to-do. I haven't done any research on the feasibility.