Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

GvSig Mobile Foss4G 2008

969 views

Published on

How to write java code that runs in J2SE and Java CDC Personal Profile. From the gvSIG Mobile developers

Published in: Technology
  • Be the first to comment

  • Be the first to like this

GvSig Mobile Foss4G 2008

  1. 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 developerWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 1
  2. 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 injectionWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 2
  3. 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. 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. 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. 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
  7. 7. Introduction. gvSIG MobileWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 7
  8. 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
  9. 9. New FeaturesWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 9
  10. 10. EDITINGWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 10
  11. 11. edition screenshotsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 11
  12. 12. CUSTOM FORMSWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 12
  13. 13. custom forms screenshotsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 13
  14. 14. New Features ● Edition ● Custom Forms ● GML ● KML ● GPX ● phoneME Advanced integration ● Easier installation ● BugfixesWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 14
  15. 15. Mobile Devices Laptop PDA Phone Smartphone UMPC Mini LaptopWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 15
  16. 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 GISWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 16
  17. 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 ● GPSWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 17
  18. 18. Java VersionsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 18
  19. 19. Java VersionsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 19
  20. 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 applicationsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 20
  21. 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.textWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 21
  22. 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.xmlWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 22
  23. 23. Java Versions – CDC PP Packages in J2ME CDC PP and NOT in J2SE javax.microedition.io javax.microedition.pki javax.microedition.xletWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 23
  24. 24. Java Versions – CDC PP Other differences with J2SE ● Classes non existent in shared packages ● For example the package java.io lacks ● LineNumberInputStream ● StringBufferInputStreamWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 24
  25. 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. 26. How to code for J2SE and CDC PP TIPS for compatibilityWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 26
  27. 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 useWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 27
  28. 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 codeWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 28
  29. 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 configurationsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 29
  30. 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 differentWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 30
  31. 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 LibrariesWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 31
  32. 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. 33. Conclussions ● Its 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 pocketsWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 33
  34. 34. VIDEOSWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 34
  35. 35. Invitation ● Valencia (Spain) ● 1st-5th December ● OGC Meeting ● eclipseDay ● 4th gvSIG Meeting http://www.jornadasgvsig.gva.esWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 35
  36. 36. WEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 36
  37. 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.esWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 37
  38. 38. http://creativecommons.org/licenses/by-nc-sa/3.0/legalcodeWEDNESDAY 1 OCT FOSS4G 2008 – Cape Town, South Africa 38

×