SlideShare una empresa de Scribd logo
1 de 25
GWTcon Firenze 
Francesco Radaelli
GWT Development 
for Handheld Devices 
A successful story within 
a retail store chain 
- November 2014 -
Project Scope & Requirements 
● Remake of all mobile «apps» used by point of 
sales: 
o Item Inventory, reorder, tracking; 
o Competitor Price Survey; 
o etc. 
● Previous architecture: 
o Native “apps” build with C# .NET + Oracle DB Lite; 
o Windows CE on Motorola MC3090/MC3190. 
● Requirements: 
o Providing support to different: 
o OS: Windows CE and Window Mobile (Android, etc); 
o Device/Vendor models; 
o Applications must work without network connectivity.
Handheld Devices 
Motorola MC3190 Motorola MC55 
MEM 256MB Ram 
1GB Flash 
MEM 256MB Ram 
1GB Flash 
CPU Marvel PXA320 
624MHz 
CPU Marvel PXA320 
624MHz 
RES 320x320px RES 480x640px 
OS Windows CE OS Windows Mobile 6.5 
Datalogic Skorpio Datalogic Elf 
MEM 256MB Ram 
512MB Flash 
MEM 256MB Ram 
256MB Flash 
CPU XScale PXA310 
624 MHz 
CPU XScale PXA310 
624 MHz 
RES 240x320px RES 480x640px 
OS Windows Mobile 6.5 OS Windows Mobile 6.5
Architecture 
● Web-based solution. 
● Adopted technologies: 
o Client: 
 GWT: v.2.5.1; 
 HTML5: application cache manifest, local storage, 
web message; 
 JBoss Errai: CDI, JAX-RS; 
 RhoMobile Suite: v.4.1.0. 
o Server: 
 Java EE: JAX-RS v1.1 (Jersey v.1.9.1), EJB 
(v.3.1), JPA v.2.0; 
 Oracle Weblogic 12c; 
 Apache HTTP Server (static content);
RhoMobile Suite 
● Build native enterprise mobile apps using web 
skills: JS, HTML5 and CSS3. 
● Includes: 
o RhoMobile “mobile application container”: 
● Rhodes JS/Ruby API: access to device level 
capabilities like camera, geo-location, etc. 
● RhoElements JS/Ruby API: access to Motorola 
hardware capabilities like bar code scanner, etc. 
o RhoStudio (Eclipse based) 
o RhoConnect and RhoGallery 
● Supports several mobile OSs: 
o Android, Apple iOS, Windows Embedded Handheld, 
Windows CE and Windows Phone 8. 
● Provides a Webkit based browser to Windows 
Mobile/CE platforms.
Framework Dependecies 
PDA Framework 
RhoMobile 
«GWT wrapper» 
HTML5 
Application Cache 
HTML5 
Web Message 
«GWT wrapper» 
JBoss Errai 
GWT 
RhoMobile JS API 
Applications 
MGWT 
RhoMobile Runtime RhoMobile Exts
PDA Framework Components 
Various UI Managers 
Application 
Manager 
Battery 
Manager 
Notification 
Manager 
Local Data 
Manager 
Remote 
Command 
Manager 
Theme 
Manager 
Signal 
Manager 
Barcode 
Manager 
Dialogs Buttons Others 
Caches 
Remote 
Logging 
Persistent 
Queue 
Local 
Databases 
Themes 
Cache 
Manager 
Battery 
Wrapper 
Battery 
Wrapper 
Database 
Wrapper 
Signal 
Wrapper 
Barcode 
Wrapper 
RhoMobile JS API
Barcode GWT Wrapper 
Errai CDI 
GWT Deferred Binding 
GWT JSNI: Motorola (default) implementation 
GWT JSNI: Datalogic implementation
Code Optimization 
- Deferred Binding - 
Motorola MC3190 Motorola MC55 
MEM 256MB Ram 
1GB Flash 
MEM 256MB Ram 
1GB Flash 
CPU Marvel PXA320 
624MHz 
CPU Marvel PXA320 
624MHz 
RES 320x320px RES 480x640px 
OS Windows CE OS Windows Mobile 6.5 
Datalogic Skorpio Datalogic Elf 
MEM 256MB Ram 
512MB Flash 
MEM 256MB Ram 
256MB Flash 
CPU XScale PXA310 
624 MHz 
CPU XScale PXA310 
624 MHz 
RES 240x320px RES 480x640px 
OS Windows Mobile 6.5 OS Windows Mobile 6.5
Deferred Binding… (1/2) 
1. «device.model» property definition. 
3. «device.vendor» property definition. 
4. «device.display» property definition. 
2. property «device.model» property-provider 
definition.
Deferred Binding… (2/2) 
1. «device.vendor» property controls barcode and WIFI signals implementations and some 
others system properties. 
2. «device.display» property controls display/layout resource bundles e css classes. 
4 devices 4 permutations
Web Applications and... offline 
● Requirements: 
o Applications must boot in case of network/server 
problems («offline»); 
o Application data must persist in «offline» mode and 
after a reboot. 
● Standard HTML5 features have been used: 
o Application Cache Manifest; 
o Local Storage.
Application Cache Manifest 
● Not available in GWT«out of the box». 
● MGWT library (v.1.1.2) has been used. 
● Consists in: 
o A further linker at compilation-time. 
o A Servlet that returns the right manifest file at run-time. 
● Custom permutation provider based on the 
property «device.model».
Application Cache Manifest 
- Compile Time - 
1 
manifest.map 
artifacts 
2 
PermutationMapLinker
Application Cache Manifest 
- Run Time - 
server 
manifest.map 
2: read 
4 
client 
mc3100 
6 
artifacts 
4: request 
5: response 
E4080E6DBA00EBDBFCDE21EB12A3F855.manifest 
ApplicationCache.db
Local Storage 
- Incoming Data Persistence - 
HTML5 Local Storage 
Errai JSON marshaller 
0110101010
Local Storage 
- Outgoing Data Persistence - 
● Implementation of a custom persistent queue 
for outgoing data: PersistentQueue<T>. 
● Outgoing data is stored in «Errai» json format. 
● Data is consumed asynchronously by «generic» 
consumer PersistentQueueConsumer<T>. 
● Outgoing data is sent to the server in 
«Jackson» json format (fast transformation) by 
PersistentQueueConsumerRemoteCallback with 
a PUT/POST. 
● Consumer can be also connected to 
NotificationManager. 
0110101010
PersistentQueueConsumer<T> 
● «Consumes» outgoing data when: 
o Queue items number is greater than a lower bound; 
o User does not interact with the device for specific amount 
of time. 
● Tries to consume a single item: 
o On success: 
 Removes the item from the queue. 
 Consumes other items all together (up to an upper 
bound). 
o On failure: 
 reschedules itself with a delay that grows exponentially 
(up to an upper bound).
«App» Architecture 
- Performance Considerations (MC3190)- 
● 256MB  ~132MB really available. 
● RhoMobile takes ~20s to start & ~ 23MB of memory  108MB 
free. 
● Different Build Modes: 
o Standalone applications (AppN.cache.js ~2MB): 
 Useful during the application development. 
 “Low” memory usage: ~58MB (~44%). 
 Integration among applications was more tricky (one 
application running per time). 
 Menu startup is slow (~30s, just once). 
 Application launch is too slow (~40s, many times). 
o Monolithic Application (AllApps.cache.js ~3.6MB): 
 Full application startup is slower (~65s, just once). 
 But application launch is very fast (~0s, many times). 
 Higher integration among application. 
 Higher memory usage: ~83MB (~63%). 
App 6 
Menu 
App 1 
App 2 
App 3 
App 5 
App 4 
Menu 
App 1 
App 2 
App 6 
App 3 
App 5 
App 4
References 
● GWT: 
http://www.gwtproject.org/articles/mvp-architecture.html 
● mgwt: 
http://www.m-gwt.com/ 
● RhoMobile Suite: 
http://docs.rhomobile.com/ 
● JBoss Errai: 
http://erraiframework.org/ 
● HTML5 cache Manifest: 
http://www.w3.org/TR/2011/WD-html5-20110525/offline.html 
● HTML5 Web Storage: 
http://www.w3.org/TR/webstorage/ 
● HTML5 Web Messaging: 
http://www.w3.org/TR/webmessaging/
Q&A
<Thank You!>
GWT Development for Handheld Devices

Más contenido relacionado

La actualidad más candente

kube-green | Davide Bianchi
kube-green | Davide Bianchikube-green | Davide Bianchi
kube-green | Davide BianchiKCDItaly
 
MEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webMEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webEugenio Minardi
 
Sviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailSviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailDotNetMarche
 
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015Codemotion
 
ASP .NET Core hands-on
ASP .NET Core hands-onASP .NET Core hands-on
ASP .NET Core hands-onugidotnet
 
m2eclipse: integrazione maven2 in eclipse IDE
m2eclipse: integrazione maven2 in eclipse IDEm2eclipse: integrazione maven2 in eclipse IDE
m2eclipse: integrazione maven2 in eclipse IDEMarcello Teodori
 
Applicazioni Serverless con AWS
Applicazioni Serverless con AWSApplicazioni Serverless con AWS
Applicazioni Serverless con AWSsparkfabrik
 
Alla scoperta di gRPC
Alla scoperta di gRPCAlla scoperta di gRPC
Alla scoperta di gRPCAndrea Dottor
 
Blazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormBlazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormAndrea Dottor
 
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...Codemotion
 
Blazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiBlazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiAndrea Dottor
 
Creare API pubbliche, come evitare gli errori comuni
Creare API pubbliche, come evitare gli errori comuniCreare API pubbliche, come evitare gli errori comuni
Creare API pubbliche, come evitare gli errori comuniAndrea Dottor
 
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Andrea Agnoletto
 
Mobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web DevelopersMobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web Developerssparkfabrik
 
Node.js – Convincing the boss
Node.js – Convincing the bossNode.js – Convincing the boss
Node.js – Convincing the bossClaudio Cicali
 
Cosa c'è di nuovo in asp.net core 2 0
Cosa c'è di nuovo in asp.net core 2 0Cosa c'è di nuovo in asp.net core 2 0
Cosa c'è di nuovo in asp.net core 2 0Andrea Dottor
 
Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?Flavius-Florin Harabor
 
Tutte le novità di ASP.NET MVC3
Tutte le novità di ASP.NET MVC3Tutte le novità di ASP.NET MVC3
Tutte le novità di ASP.NET MVC3Manuel Scapolan
 
Modernize Legacy Systems with Kubernetes
Modernize Legacy Systems with KubernetesModernize Legacy Systems with Kubernetes
Modernize Legacy Systems with KubernetesGiulio Roggero
 

La actualidad más candente (20)

kube-green | Davide Bianchi
kube-green | Davide Bianchikube-green | Davide Bianchi
kube-green | Davide Bianchi
 
MEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webMEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del web
 
Sviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailSviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle Monorail
 
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
Java EE facile con Spring Boot - Luigi Bennardis - Codemotion Roma 2015
 
ASP .NET Core hands-on
ASP .NET Core hands-onASP .NET Core hands-on
ASP .NET Core hands-on
 
m2eclipse: integrazione maven2 in eclipse IDE
m2eclipse: integrazione maven2 in eclipse IDEm2eclipse: integrazione maven2 in eclipse IDE
m2eclipse: integrazione maven2 in eclipse IDE
 
Applicazioni Serverless con AWS
Applicazioni Serverless con AWSApplicazioni Serverless con AWS
Applicazioni Serverless con AWS
 
Alla scoperta di gRPC
Alla scoperta di gRPCAlla scoperta di gRPC
Alla scoperta di gRPC
 
Blazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormBlazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web Form
 
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
Moving from Monolithic to Microservice Architecture: an OSS based stack deplo...
 
Blazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiBlazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi reali
 
Creare API pubbliche, come evitare gli errori comuni
Creare API pubbliche, come evitare gli errori comuniCreare API pubbliche, come evitare gli errori comuni
Creare API pubbliche, come evitare gli errori comuni
 
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?
 
Mobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web DevelopersMobile Development: una introduzione per Web Developers
Mobile Development: una introduzione per Web Developers
 
Node.js – Convincing the boss
Node.js – Convincing the bossNode.js – Convincing the boss
Node.js – Convincing the boss
 
Cosa c'è di nuovo in asp.net core 2 0
Cosa c'è di nuovo in asp.net core 2 0Cosa c'è di nuovo in asp.net core 2 0
Cosa c'è di nuovo in asp.net core 2 0
 
Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?
 
Tutte le novità di ASP.NET MVC3
Tutte le novità di ASP.NET MVC3Tutte le novità di ASP.NET MVC3
Tutte le novità di ASP.NET MVC3
 
Vaadin7
Vaadin7Vaadin7
Vaadin7
 
Modernize Legacy Systems with Kubernetes
Modernize Legacy Systems with KubernetesModernize Legacy Systems with Kubernetes
Modernize Legacy Systems with Kubernetes
 

Similar a GWT Development for Handheld Devices

Come sviluppare applicazioni cross device con HTML
Come sviluppare applicazioni cross device con HTMLCome sviluppare applicazioni cross device con HTML
Come sviluppare applicazioni cross device con HTMLSinergia Totale
 
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progettoMicrosoft Mobile Developer
 
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezzaAndroid: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezzajekil
 
SkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoSkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoMavigex srl
 
I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)Diego La Monica
 
Meetup Fluent Design e Progressive Web App
Meetup Fluent Design e Progressive Web AppMeetup Fluent Design e Progressive Web App
Meetup Fluent Design e Progressive Web Appdotnetcode
 
Meetup Progressive Web App
Meetup Progressive Web AppMeetup Progressive Web App
Meetup Progressive Web Appdotnetcode
 
Sviluppo di applicazioni mobile con PhoneGap
Sviluppo di applicazioni mobile con PhoneGapSviluppo di applicazioni mobile con PhoneGap
Sviluppo di applicazioni mobile con PhoneGapDotNetMarche
 
Asynchronous Java ME and XML
Asynchronous Java ME and XMLAsynchronous Java ME and XML
Asynchronous Java ME and XMLAndrea Castello
 
Sviluppare una app mobile net oriented
Sviluppare una app mobile net orientedSviluppare una app mobile net oriented
Sviluppare una app mobile net orientedAlessandro Morvillo
 
Introduzione al sistema operativo mobile Android
Introduzione al sistema operativo mobile AndroidIntroduzione al sistema operativo mobile Android
Introduzione al sistema operativo mobile AndroidOpen Makers Italy
 
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...Mattia De Bernardi
 
Are you a Gadgeteer? - NetMF@Work
Are you a Gadgeteer? - NetMF@WorkAre you a Gadgeteer? - NetMF@Work
Are you a Gadgeteer? - NetMF@WorkMirco Vanini
 

Similar a GWT Development for Handheld Devices (20)

Come sviluppare applicazioni cross device con HTML
Come sviluppare applicazioni cross device con HTMLCome sviluppare applicazioni cross device con HTML
Come sviluppare applicazioni cross device con HTML
 
Introduzione ad Android
Introduzione ad AndroidIntroduzione ad Android
Introduzione ad Android
 
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
Le basi per lo sviluppo su Windows Phone tool, SDK, il primo progetto
 
Rich Internet Application
Rich Internet ApplicationRich Internet Application
Rich Internet Application
 
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezzaAndroid: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
 
SkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimentoSkyMedia: La tecnologia al servizio dell'intrattenimento
SkyMedia: La tecnologia al servizio dell'intrattenimento
 
I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)
 
Cac Es3 2009
Cac Es3 2009Cac Es3 2009
Cac Es3 2009
 
Meetup Fluent Design e Progressive Web App
Meetup Fluent Design e Progressive Web AppMeetup Fluent Design e Progressive Web App
Meetup Fluent Design e Progressive Web App
 
Meetup Progressive Web App
Meetup Progressive Web AppMeetup Progressive Web App
Meetup Progressive Web App
 
Sviluppo di applicazioni mobile con PhoneGap
Sviluppo di applicazioni mobile con PhoneGapSviluppo di applicazioni mobile con PhoneGap
Sviluppo di applicazioni mobile con PhoneGap
 
Asynchronous Java ME and XML
Asynchronous Java ME and XMLAsynchronous Java ME and XML
Asynchronous Java ME and XML
 
Sviluppare una app mobile net oriented
Sviluppare una app mobile net orientedSviluppare una app mobile net oriented
Sviluppare una app mobile net oriented
 
Introduzione al sistema operativo mobile Android
Introduzione al sistema operativo mobile AndroidIntroduzione al sistema operativo mobile Android
Introduzione al sistema operativo mobile Android
 
App Engine + Python
App Engine + PythonApp Engine + Python
App Engine + Python
 
Android
AndroidAndroid
Android
 
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...
Sviluppo di un'applicazione ibrida su dispositivo mobile per l'interfacciamen...
 
Mobile e Smart Client
Mobile e Smart ClientMobile e Smart Client
Mobile e Smart Client
 
Are you a Gadgeteer? - NetMF@Work
Are you a Gadgeteer? - NetMF@WorkAre you a Gadgeteer? - NetMF@Work
Are you a Gadgeteer? - NetMF@Work
 
Java sul tuo Mac
Java sul tuo MacJava sul tuo Mac
Java sul tuo Mac
 

Más de GWTcon

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...GWTcon
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James NelsonGWTcon
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthGWTcon
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniGWTcon
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoGWTcon
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthGWTcon
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian WangGWTcon
 
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhGWTcon
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoGWTcon
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald PehlGWTcon
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3GWTcon
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...GWTcon
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTCGWTcon
 

Más de GWTcon (15)

"Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene..."Jclays, A global solution for application design and automatic GWT code gene...
"Jclays, A global solution for application design and automatic GWT code gene...
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
In defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin AlworthIn defense of GWT-RPC By Colin Alworth
In defense of GWT-RPC By Colin Alworth
 
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto ManciniDIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
DIY: Split GWT Applications using TURDUCKEN approach By Alberto Mancini
 
Unirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario CarotenutoUnirex Lean tools By Dario Carotenuto
Unirex Lean tools By Dario Carotenuto
 
The future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin AlworthThe future of GWT 2.x - By Colin Alworth
The future of GWT 2.x - By Colin Alworth
 
Web components with java by Haijian Wang
Web components with java by Haijian WangWeb components with java by Haijian Wang
Web components with java by Haijian Wang
 
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla KobyliukhUI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
UI Framework Development using GWT and HTML Canvas - By Iarosla Kobyliukh
 
Best Practices - By Lofi Dewanto
Best Practices - By Lofi DewantoBest Practices - By Lofi Dewanto
Best Practices - By Lofi Dewanto
 
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl"Migrate large gwt applications - Lessons Learned" By Harald Pehl
"Migrate large gwt applications - Lessons Learned" By Harald Pehl
 
GWT vs CSS3
GWT vs CSS3GWT vs CSS3
GWT vs CSS3
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
GWTcon 2014 - Apertura
GWTcon 2014 - AperturaGWTcon 2014 - Apertura
GWTcon 2014 - Apertura
 
GWT videocall: power-up your mobile & web app with WebRTC
GWT videocall:  power-up your mobile & web app with WebRTCGWT videocall:  power-up your mobile & web app with WebRTC
GWT videocall: power-up your mobile & web app with WebRTC
 

GWT Development for Handheld Devices

  • 1.
  • 3. GWT Development for Handheld Devices A successful story within a retail store chain - November 2014 -
  • 4. Project Scope & Requirements ● Remake of all mobile «apps» used by point of sales: o Item Inventory, reorder, tracking; o Competitor Price Survey; o etc. ● Previous architecture: o Native “apps” build with C# .NET + Oracle DB Lite; o Windows CE on Motorola MC3090/MC3190. ● Requirements: o Providing support to different: o OS: Windows CE and Window Mobile (Android, etc); o Device/Vendor models; o Applications must work without network connectivity.
  • 5. Handheld Devices Motorola MC3190 Motorola MC55 MEM 256MB Ram 1GB Flash MEM 256MB Ram 1GB Flash CPU Marvel PXA320 624MHz CPU Marvel PXA320 624MHz RES 320x320px RES 480x640px OS Windows CE OS Windows Mobile 6.5 Datalogic Skorpio Datalogic Elf MEM 256MB Ram 512MB Flash MEM 256MB Ram 256MB Flash CPU XScale PXA310 624 MHz CPU XScale PXA310 624 MHz RES 240x320px RES 480x640px OS Windows Mobile 6.5 OS Windows Mobile 6.5
  • 6. Architecture ● Web-based solution. ● Adopted technologies: o Client:  GWT: v.2.5.1;  HTML5: application cache manifest, local storage, web message;  JBoss Errai: CDI, JAX-RS;  RhoMobile Suite: v.4.1.0. o Server:  Java EE: JAX-RS v1.1 (Jersey v.1.9.1), EJB (v.3.1), JPA v.2.0;  Oracle Weblogic 12c;  Apache HTTP Server (static content);
  • 7. RhoMobile Suite ● Build native enterprise mobile apps using web skills: JS, HTML5 and CSS3. ● Includes: o RhoMobile “mobile application container”: ● Rhodes JS/Ruby API: access to device level capabilities like camera, geo-location, etc. ● RhoElements JS/Ruby API: access to Motorola hardware capabilities like bar code scanner, etc. o RhoStudio (Eclipse based) o RhoConnect and RhoGallery ● Supports several mobile OSs: o Android, Apple iOS, Windows Embedded Handheld, Windows CE and Windows Phone 8. ● Provides a Webkit based browser to Windows Mobile/CE platforms.
  • 8. Framework Dependecies PDA Framework RhoMobile «GWT wrapper» HTML5 Application Cache HTML5 Web Message «GWT wrapper» JBoss Errai GWT RhoMobile JS API Applications MGWT RhoMobile Runtime RhoMobile Exts
  • 9. PDA Framework Components Various UI Managers Application Manager Battery Manager Notification Manager Local Data Manager Remote Command Manager Theme Manager Signal Manager Barcode Manager Dialogs Buttons Others Caches Remote Logging Persistent Queue Local Databases Themes Cache Manager Battery Wrapper Battery Wrapper Database Wrapper Signal Wrapper Barcode Wrapper RhoMobile JS API
  • 10. Barcode GWT Wrapper Errai CDI GWT Deferred Binding GWT JSNI: Motorola (default) implementation GWT JSNI: Datalogic implementation
  • 11. Code Optimization - Deferred Binding - Motorola MC3190 Motorola MC55 MEM 256MB Ram 1GB Flash MEM 256MB Ram 1GB Flash CPU Marvel PXA320 624MHz CPU Marvel PXA320 624MHz RES 320x320px RES 480x640px OS Windows CE OS Windows Mobile 6.5 Datalogic Skorpio Datalogic Elf MEM 256MB Ram 512MB Flash MEM 256MB Ram 256MB Flash CPU XScale PXA310 624 MHz CPU XScale PXA310 624 MHz RES 240x320px RES 480x640px OS Windows Mobile 6.5 OS Windows Mobile 6.5
  • 12. Deferred Binding… (1/2) 1. «device.model» property definition. 3. «device.vendor» property definition. 4. «device.display» property definition. 2. property «device.model» property-provider definition.
  • 13. Deferred Binding… (2/2) 1. «device.vendor» property controls barcode and WIFI signals implementations and some others system properties. 2. «device.display» property controls display/layout resource bundles e css classes. 4 devices 4 permutations
  • 14. Web Applications and... offline ● Requirements: o Applications must boot in case of network/server problems («offline»); o Application data must persist in «offline» mode and after a reboot. ● Standard HTML5 features have been used: o Application Cache Manifest; o Local Storage.
  • 15. Application Cache Manifest ● Not available in GWT«out of the box». ● MGWT library (v.1.1.2) has been used. ● Consists in: o A further linker at compilation-time. o A Servlet that returns the right manifest file at run-time. ● Custom permutation provider based on the property «device.model».
  • 16. Application Cache Manifest - Compile Time - 1 manifest.map artifacts 2 PermutationMapLinker
  • 17. Application Cache Manifest - Run Time - server manifest.map 2: read 4 client mc3100 6 artifacts 4: request 5: response E4080E6DBA00EBDBFCDE21EB12A3F855.manifest ApplicationCache.db
  • 18. Local Storage - Incoming Data Persistence - HTML5 Local Storage Errai JSON marshaller 0110101010
  • 19. Local Storage - Outgoing Data Persistence - ● Implementation of a custom persistent queue for outgoing data: PersistentQueue<T>. ● Outgoing data is stored in «Errai» json format. ● Data is consumed asynchronously by «generic» consumer PersistentQueueConsumer<T>. ● Outgoing data is sent to the server in «Jackson» json format (fast transformation) by PersistentQueueConsumerRemoteCallback with a PUT/POST. ● Consumer can be also connected to NotificationManager. 0110101010
  • 20. PersistentQueueConsumer<T> ● «Consumes» outgoing data when: o Queue items number is greater than a lower bound; o User does not interact with the device for specific amount of time. ● Tries to consume a single item: o On success:  Removes the item from the queue.  Consumes other items all together (up to an upper bound). o On failure:  reschedules itself with a delay that grows exponentially (up to an upper bound).
  • 21. «App» Architecture - Performance Considerations (MC3190)- ● 256MB  ~132MB really available. ● RhoMobile takes ~20s to start & ~ 23MB of memory  108MB free. ● Different Build Modes: o Standalone applications (AppN.cache.js ~2MB):  Useful during the application development.  “Low” memory usage: ~58MB (~44%).  Integration among applications was more tricky (one application running per time).  Menu startup is slow (~30s, just once).  Application launch is too slow (~40s, many times). o Monolithic Application (AllApps.cache.js ~3.6MB):  Full application startup is slower (~65s, just once).  But application launch is very fast (~0s, many times).  Higher integration among application.  Higher memory usage: ~83MB (~63%). App 6 Menu App 1 App 2 App 3 App 5 App 4 Menu App 1 App 2 App 6 App 3 App 5 App 4
  • 22. References ● GWT: http://www.gwtproject.org/articles/mvp-architecture.html ● mgwt: http://www.m-gwt.com/ ● RhoMobile Suite: http://docs.rhomobile.com/ ● JBoss Errai: http://erraiframework.org/ ● HTML5 cache Manifest: http://www.w3.org/TR/2011/WD-html5-20110525/offline.html ● HTML5 Web Storage: http://www.w3.org/TR/webstorage/ ● HTML5 Web Messaging: http://www.w3.org/TR/webmessaging/
  • 23. Q&A