SlideShare a Scribd company logo
GWT Development for Handheld Devices
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

More Related Content

PDF
Il Web orientato al futuro: Express, Angular e nodeJS
PDF
Continuous Delivery Database - Diego Mauricio Lagos Morales - Codemotion Rome...
PDF
Con Aruba, a lezione di cloud #lezione 29: 'GitLab e Cloud Server Smart - Ins...
PPTX
.NET Core, ASP.NET Core e Linux per il Mobile
PDF
Angular js o React? Spunti e idee per la scelta di un framework
PDF
Dal RenderFragment ai Generics, tips for Blazor developers
PPTX
Introduzione ad ASP.NET Core
PPT
Esempi pratici
Il Web orientato al futuro: Express, Angular e nodeJS
Continuous Delivery Database - Diego Mauricio Lagos Morales - Codemotion Rome...
Con Aruba, a lezione di cloud #lezione 29: 'GitLab e Cloud Server Smart - Ins...
.NET Core, ASP.NET Core e Linux per il Mobile
Angular js o React? Spunti e idee per la scelta di un framework
Dal RenderFragment ai Generics, tips for Blazor developers
Introduzione ad ASP.NET Core
Esempi pratici

What's hot (20)

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

Similar to GWT Development for Handheld Devices (20)

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

More from GWTcon (15)

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

GWT Development for Handheld Devices

  • 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