Skip to content

PnX-SI/gn_mobile_occtax

master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Occtax-mobile

GeoNature Android mobile application for Occtax GeoNature module.

Based on datasync module to synchronize data and maps module to show maps data.

Documentation

Launcher icons

Name Flavor Launcher icon
Default generic PNX PNX_debug

Settings

Example:

{
  "area_observation_duration": 365,
  "sync": {
    "geonature_url": "https://demo.geonature/geonature",
    "taxhub_url": "https://demo.geonature/taxhub",
    "gn_application_id": 3,
    "observers_list_id": 1,
    "taxa_list_id": 100,
    "code_area_type": "M1",
    "page_size": 10000
  },
  "map": {
    "show_scale": true,
    "show_compass": true,
    "max_bounds": [
      [52.0, -6.0],
      [41.0, 9.0]
    ],
    "center": [46.0, 3.0],
    "start_zoom": 10.0,
    "min_zoom": 8.0,
    "max_zoom": 19.0,
    "min_zoom_editing": 12.0,
    "base_path": "Offline_maps",
    "layers": [
      {
        "source": "plan.mbtiles",
        "label": "IGN plan"
      },
      {
        "source": "ortho.mbtiles",
        "label": "IGN ortho"
      },
      {
      "label": "OpenStreetMap",
      "source": "https://a.tile.openstreetmap.org/",
      "properties": {
        "attribution": "© OSM contributors"
        }
      },
      {
      "label": "Mailles 5x5",
      "source": "mailles.geojson"
      }
    ]
  },
  "input": {
    "date": {
      "enable_end_date": true,
      "enable_hours": true
    }
  }
}

Parameters description

Parameter UI Description Default value
area_observation_duration Area observation duration period (in days) 365
sync Data synchronization settings (cf. https://github.com/PnX-SI/gn_mobile_core/tree/develop/datasync)
map Maps settings (cf. https://github.com/PnX-SI/gn_mobile_maps/tree/develop/maps)
input Input form settings
input/date Date settings
nomenclature Nomenclature settings
nomenclature/information Information settings (as array)
nomenclature/counting Counting settings (as array)

Input settings

Allows to configure settings related to user input.

Date settings

How the user can set the start and end date of the input:

Parameter Description Default value
enable_end_date Whether to edit as well the end date of the input false
enable_hours Whether to edit as well the hour part of the start and end date (if enabled) false

The combination of these parameters gives the following configuration:

  • enable_end_date and enable_hours are set to false: only the start date without the hour part is editable
  • only enable_end_date is set to true: the start and end date without the hour part are editable
  • only enable_hours is set to true: only the start date including the hour part is editable
  • enable_end_date and enable_hours are set to true: the start and end date with the hour part are editable

If nothing is configured, only the start date without the hour part is editable.

Nomenclature settings

Allows to define if fields are displayed by default and if they are editable (visible). If a field is not editable (visible), it will use the default value set in Occtax database.

All these settings may not be defined and the default values will then be used instead:

Information settings

Nomenclature Label Displayed by default Editable (visible)
METH_OBS Observation methods true true
ETA_BIO Biological state true true
METH_DETERMIN Determination method false true
DETERMINER Determiner false true
STATUT_BIO Biological status false true
OCC_COMPORTEMENT Behaviour false true
NATURALITE Level of naturalness false true
PREUVE_EXIST Proof of existence false true
COMMENT Comment false true

Counting settings

Nomenclature Label Displayed by default Editable (visible)
STADE_VIE Life stage true true
SEXE Sex true true
OBJ_DENBR Purpose of the enumeration true true
TYP_DENBR Type of enumeration true true
MIN Min true true
MAX Max true true

Note: Any unknown nomenclature attribute added will be simply ignored at startup.

You can override these default settings by adding a property for each nomenclature settings, e.g:

{
  "nomenclature": {
    "information": [
      "METH_OBS",
      {
        "key": "ETA_BIO"
      },
      {
        "key": "METH_DETERMIN",
        "visible": true,
        "default": true
      },
      {
        "key": "STATUT_BIO",
        "visible": true,
        "default": false
      },
      {
        "key": "OCC_COMPORTEMENT",
        "visible": true,
        "default": false
      },
      {
        "key": "NATURALITE",
        "visible": true,
        "default": false
      },
      {
        "key": "PREUVE_EXIST",
        "visible": true,
        "default": false
      }
    ],
    "counting": ["STADE_VIE", "SEXE", "OBJ_DENBR", "TYP_DENBR"]
  }
}

Each property may be a simple string representing the nomenclature attribute to show or an object with the following properties:

Property Description Mandatory
key The nomenclature attribute
visible If this attribute is visible (thus editable) or not (default: true)
default If this attribute is shown by default (default: true)

Example:

  • "METH_OBS" has the same meaning like

    {
      "key": "METH_OBS"
    }

    or

    {
      "key": "METH_OBS",
      "visible": true
    }

    or

    {
      "key": "METH_OBS",
      "default": true
    }

    or

    {
      "key": "METH_OBS",
      "visible": true,
      "default": true
    }
  • An omitted property (e.g. METH_OBS) has the same meaning like

    {
      "key": "METH_OBS",
      "visible": false
    }

Upgrade git sub modules

Do NOT modify directly any git sub modules (e.g. commons, mountpoint, viewpager and maps). Any changes should be made from each underlying git repository:

./upgrade_submodules.sh

Troubleshooting

  • Kotlin error, Redeclaration from class within imported module:

    clean project from menu Build -> Clean Project, then rebuild project.

Full Build

A full build can be executed with the following command:

./gradlew clean assembleDebug

Financial support

This application have been developped with the financial support of the Office Français de la Biodiversité