H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
GvSig Mobile Foss4G 2008
1. gvSIG Mobile
How to code for desktop and mobile GIS/SDI
Miguel Montesinos Javier Carrasco
Project Manager Project Development Chief
gvSIG technical committee gvSIG technical committee
gvSIG management committee gvSIG developer
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 1
2. Agenda
●
Introduction
● New features in gvSIG Mobile
●
Mobile Devices
●
Java versions
●
J2SE-J2ME Compatibility Tips
●
Take packages from J2SE VMs
●
Use the compatible alternative
● MVC Splitting and dependency injection
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 2
3. Introduction
Introduction. Prodevelop
● Spanish company, Valencia
●
15 years of GIS experience
●
More than 50 people
● Member of gvSIG dev. team
● High focus on FOSS4G
www.prodevelop.es
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 3
4. Introduction
Introduction. gvSIG context
● Full-fledged GIS desktop with:
●
Vector/Raster support.
● SDI client (WMS, WMC, WFS, WCS, CSW, ...)
●
Analysis (Sextante project)
●
Edition, projections, adv.symbology, ...
● Going on:
● 3D
●
Network Analysis
●
Raster & remote sensing
● Adv. Analysis
●
4D, Sensor
●
European Union funds until 2013
● Available in 10+ languages
● Around 1.500 users subscribed to lists
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 4
5. Introduction
Introduction. gvSIG @ FOSS4G2008
● PAL. A Cartographic Labeling Library
●
Olivier Ertz, Maxence Laurent, Daniel Rappo, Abson Sae-
Tang, Eric Taillard. Room 2.6a. TUESDAY 30 SEPT
●
●
Multipurpose metadata management in gvSIG
●
Laura Díaz. Room 2.6a (297). TUESDAY 30 SEPT
●
●
Improving open source GIS-SDI integration: the web service
publishing extension for gvSIG
●
Salvador Bayarri. Room 2.4b (120) THURSDAY 10:30
●
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 5
6. Introduction
Introduction. gvSIG @ FOSS4G2008
●
●
gvSIG Status Report. Towards an open organization
●
Miguel Montesinos. Room 1.6 (260) THURSDAY 10:30
●
●
A free graphical modeling tool for geospatial analysis
● Victor Olaya. Room 1.6 (260) THURSDAY 10:30
●
●
Introduction to gvSIG/SEXTANTE as desktop GIS with
advanced spatial analysis and SDI publishing tools
●
Victor Olaya, Salvador Bayarri, Jose Vicente Higon, Laura Diaz
●
Workshop CODE: WS-F-8. FRIDAY 13:30
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 6
8. Introduction
Introduction. gvSIG Mobile
●
gvSIG for mobile devices
●
Developed by:
●
Prodevelop
●
Robotics Institute @ Univ. of Valencia
● IVER
● New version in october
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 8
14. New Features
●
Edition
● Custom Forms
●
GML
●
KML
●
GPX
●
phoneME Advanced integration
● Easier installation
● Bugfixes
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 14
15. Mobile Devices
Laptop
PDA
Phone
Smartphone
UMPC
Mini Laptop
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 15
16. Mobile Devices
Portable PCs Mobile Phones
● Desktop OS ●
Propietary OS
●
Powerful processors ●
Slow processors
●
More than 512 RAM ● Very small memory
●
J2SE ● J2ME CLDC
●
Capable of running ●
Small non.touch screens
gvSIG desktop ●
Too limited for a
complete GIS
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 16
17. Mobile Devices
PDAs and Smartphones
●
Cheap devices (200€+)
●
Touchscreens (240x360 or more)
●
J2ME CDC PP (Subset of J2SE)
● ARM 400MHz+ processors
●
64-128MB RAM
●
GPRS/UMTS internet
● Camera
● GPS
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 17
20. Mobile Devices – Java Versions
●
Mobile Phones:
●
CLDC MIDP limited but connected map viewers
●
● Portable PCs:
●
Existing J2SE applications with customized GUIs
●
●
Smartphones and PDAs:
●
J2SE VMs for PDA runned too slow
●
J2ME CDC PP
● New applications
●
Share libraries with desktop applications
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 20
21. Java Versions – CDC PP
Packages in both J2SE and in J2ME CDC PP
java.util java.io
java.applet java.awt java.lang
java.net java.rmi java.math
java.security java.beans java.text
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 21
22. Java Versions – CDC PP
Packages in J2SE and NOT in J2ME CDC PP
java.sql
java.awt.geom javax.imageio javax.security
javax.sql
java.awt.dnd java.util.logging javax.sound javax.naming
java.awt.print
java.util.prefs javax.swing javax.net
javax.print
org.w3c.dom
java.nio java.util.regex org.xml javax.rmi
javax.xml
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 22
23. Java Versions – CDC PP
Packages in J2ME CDC PP and NOT in J2SE
javax.microedition.io
javax.microedition.pki
javax.microedition.xlet
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 23
24. Java Versions – CDC PP
Other differences with J2SE
● Classes non existent in shared packages
● For example the package java.io lacks
●
LineNumberInputStream
● StringBufferInputStream
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 24
25. Java Versions – CDC PP
Other differences with J2SE
● Methods non existent in shared classes
●
For example String class lack the methods:
●
getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin)
●
matches(String regex)
●
replaceAll(String regex, String replacement)
● replaceFirst(String regex, String replacement)
●
split(String regex)
●
split(String regex, int limit)
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 25
26. How to code for J2SE and CDC PP
TIPS for compatibility
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 26
27. J2SE – CDC PP Compatibility Tips
Tip 1
If you need a package just take it
Most VMs allow you to add protected packages
java -Xbootclasspath:myawtgeom.jar ...
There are free implementations of J2SE we can use
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 27
28. J2SE – CDC PP Compatibility Tips
Tip 1
If you need a package just take it
●
Worked very well to add
●
java.awt.geom
● java.util.regex
We can use only pure java 1.4 code
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 28
29. J2SE – CDC PP Compatibility Tips
Tip 2
Use the compatible alternative
● Use when possible packages and classes that
exist in both configurations
●
Instead of using SAX or DOM XML parsers use
lightweight pull parsers (ie KXML)
●
Use 3rd party libraries that only depends on packages
existing in both configurations
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 29
30. J2SE – CDC PP Compatibility Tips
Tip 3
MVC Separation and Dependency Injection
● Controller can to be shared
●
Some Model libraries are compatible and some
others not
●
View never is compatible
●
Dependency Injection allows you to keep some
libraries common and others different
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 30
31. J2SE – CDC PP Compatibility Tips
Tip 3
MVC Separation and Dependency Injection
Model Controller View
Desktop
Desktop
Application optimized Swing
Libraries DI
DI MDI GUI
Common Common
Libraries Controller
Mobile
Application DI
PDA DI AWT
optimized Simple GUI
Libraries
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 31
32. J2SE – CDC PP Compatibility Tips
Tip 4
Libraries of frequently used incompatible code
● Libraries with utilities not existing in CDC PP to
be used both in desktop and in mobile
●
Examples:
StringUtils NetworkUtils FileUtils
splitString() getNetFile() getImage()
replaceAll() sendEmail() fileToString()
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 32
33. Conclussions
●
It's doable to develop GIS with Java for PDAS
●
Ultramobile PCs and Low-Cost Laptops will need new
interfaces for existing desktop GIS applications
●
Java allows real portability of code
●
gvSIG now fits in our pockets
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 33
37. gvSIG Mobile
How to code for desktop and mobile GIS/SDI
Thank you very much for your attention
Miguel Montesinos Javier Carrasco
mmontesinos@prodevelop.es jcarrasco@prodevelop.es
WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 37