Requisites

First of all, to compile gvSIG Mobile 1.0 there are some needed software that have to be installed.

Download Eclipse

http://www.eclipse.org/downloads/

Install Subclipse

http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

Install PDE

After check it out if it's installed and didn't find it then can be installed using the eclipse market.

Equinox Download

http://archive.eclipse.org/equinox/drops/R-3.5-200906111540/index.php#Equinox

Install Maven

http://maven.apache.org/download.html

Downloading the gvSIG Mobile Projects

Configure gvSIG Mobile SVN

Add the gvSIG Mobile SVN

https://devel.gvsig.org/svn/gvsig-mobile

Can found more information about the project from: https://devel.gvsig.org/redmine/projects/gvsig-mobile

Downloading the workspace from the tag

Simply download all the projects from the tag:

SVN repository: https://devel.gvsig.org/svn/gvsig-mobile
Tag folder: /appGvsigMobile/tags/gvsig_mobile_1_0__22_nov_2012

Downloading the workspace from latest versions

Alternatively, you can download each project from their original URLs to get the latest versions (compilation is not guaranteed in all cases):

Download Core Bundles
  • Checkout the next projects from the SVN gvSIG Mobile repository:
BUILD PROJECT
GVSIG BASE PROJECTS:
SYMBOLS SUPPORT PROJECT:
PROJECTION PROJECT:
Download Extra Functionality Bundles
  • There are others gvSIG Mobile projects that can be downloaded to get all the gvSIG Mobile functionality, if you want all the functionalities then must download also the next projects:
SHAPEFILE FILE FORMAT SUPPORT PROJECT:
ECW FILE FORMAT SUPPORT PROJECT:
WMS PROJECT:
GML, KML FILE FORMATS PROJECT:
WFS PROJECTS:
EDITING PROJECTS:
GPS SUPPORT PROJECTS:
PROJECTION EXTENSION PROJECT:

All the bundles above are optional.

Compile bundles using maven

Download gvSIG Mobile dependencies

Editing our settings.xml file

Developers who have commit permission in the gvSIG Mobile repository should write their user/password settings here in case they need to deploy something.

Other developers need to have this settings file too (the user and password will not be used):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">

 <servers>
     <server>
         <id>gvsig-repository</id>
         <username>[user]</username>
         <password>[password]</password>
         <filePermissions>666</filePermissions>
         <directoryPermissions>777</directoryPermissions>
     </server>
 </servers>

 <!-- optionally you can change the path to your local            -->
 <!-- maven repository. Remember you have to edit the little file -->
 <!-- build/initial_m2/build.xml to point at the same folder      -->
 <localRepository>[path_to_local_maven_repo]</localRepository>

 <!-- This value is changed during the setup of the workspace -->
 <!-- (see instructions)                                      -->
 <offline>true</offline>
 </settings>

Where:

Install Dependencies

mvn -P cdc install
mvn -P cdc clean package eclipse:eclipse -Declipse.pde -Dmaven.test.skip=true install

Compile Projects and Build Eclipse Projects

mvn -P cdc clean package eclipse:eclipse -Declipse.pde -Dmaven.test.skip=true install
mvn -P cdc clean package eclipse:eclipse -Declipse.pde -Dmaven.test.skip=true install

Problems during the building

If the maven build process finish with 'BUILD SUCCESSFULL' but on Eclipse several compilation errors are shown, sometimes is because the MANIFEST.MF are bad built. Then try to:

To prevent maven memory problems during the compilation:

In Windows we have to run from System Console before projects compilation:

Configure and launch gvSIG Mobile from Eclipse

Run Workspace

CORE GVSIG MOBILE START LEVELS:
  • org.gvsig.mobile.core.GvSigCore -> Start Level 2
  • org.gvsig.mobile.dll -> Start Level 1
  • org.gvsig.mobile.extension.base -> Start Level 5
  • org.gvsig.mobile.libProjection -> Start Level 3
  • org.gvsig.mobile.core.libraries -> Start Level 1
  • org.gvsig.mobile.logging -> Start Level 1
  • org.gvsig.mobile.logging.configure -> Start Level 1
  • org.gvsig.mobile.symbology -> Start Level 3
OSGI START LEVELS:
  • javax.servlet - Servlet API Bundle -> Start Level 1
  • org.eclipse.osgi - OSGi System Bundle -> Start level 2 or Default
  • org.eclipse.osgi.services - OSGi Release 4.0.1 Services -> Start level 2
  • org.eclipse.osgi.util - OSGi Release 4.0.1 Utility Classes -> Start level 2
  • org.eclipse.equinox.util - Equinox Util Bundle -> Start level 2
  • org.eclipse.equinox.wireadmin - Wire Admin Service -> Start level 2
SHAPEFILE START LEVEL:
  • org.gvsig.mobile.dal.dalfile -> Start Level 3
ECW START LEVEL:
  • org.gvsig.mobile.extension.ecw -> Start Level 6
WMS START LEVEL:
  • org.gvsig.mobile.extension.wms -> Start Level 6
GML, KML FILE START LEVEL:
  • org.gvsig.mobile.gpe -> Start Level 4
WFS START LEVELS:
  • org.gvsig.mobile.extension.wfs -> Start Level 6
  • org.gvsig.mobile.wfs -> Start Level 4
EDITING START LEVELS:
  • org.gvsig.mobile.extension.editing -> Start Level 6
  • org.gvsig.mobile.extension.editing.gps -> Start Level 6
GPS START LEVELS:
  • org.gvsig.mobile.extension.gps -> Start Level 6
  • org.gvsig.mobile.bundle.libLocation -> Start Level 1
PROJECTION START LEVEL:
  • org.gvsig.mobile.extension.wkprojection -> Start Level 4

Once OSGI is launched, we can launch Equinox orders from Eclipse Console. Equinox show the console commands typing the command ?help?.

The most used commands are ss, start y stop:

ss: List the bundles installed on the Equinox framework.

It's possible stop and start bundles with the ?start? and ?stop? commands with the bundle number id. For instance to stop the org.gvsig.mobile.extension.base just type ?stop 13?. Those commands are useful when one bundle don't START (It shows ?ACTIVE? status) correctly then starting them with the ?start? command the console shows all the launched exceptions.

When is activated org.gvsig.mobile.dll it look for the jni libraries in the paths defined at the java.library.path. You can set this library path with -Djava.library.path = your_libraries_path option setted as VM arguments at the Arguments Tab from Run Configurations. If the java.library.path doesn't contain the JNI libraries then UnsatisfiedLinkError is launched at the app start.

Preparing the binaries after compilation

Moving the resulting compiled bundles to the device

Simply follow these steps in order to copy the resulting compiled bundles to the final device (whether it's a PDA, smartphone or PC):

build/product/gvSIG-Mobile/bundles

That folder contains subfolders with the essential and the optional bundles, depending on how your workspace is configured.

/jars/gvSIG-Mobile/bundles