Skip to content

Geocaching Field Notes

Jiří M. aka Menion edited this page Oct 7, 2016 · 1 revision

Basic information

Since the version 3.2.0, Locus Map offers full access to user's field notes. For this access a system called Content provider is used. You don't have to be too skilled with it. Most of required work is already done in Locus API and you may (and it's suggested) use already pre-prepared functions.

How to

To access field notes in read or write mode, you need

  • Installed Locus API in your IDE and added dependency to your new/existing project. More in Installation manual.
  • Permission in your AndroidManifest.xml file.

For read only access

<uses-permission android:name=“com.asamm.locus.permission.READ_GEOCACHING_DATA” />

For read/write access

<uses-permission android:name=“com.asamm.locus.permission.WRITE_GEOCACHING_DATA” />

Possibilities

Field notes in Locus are stored in SQLite databases, so all queries sent over Locus API to content provider may be defined in probably well known way for you - same as a query to SQLite database.

What is possible

  • GET, INSERT, UPDATE, DELETE queries on FieldNotes
  • GET, INSERT, UPDATE, DELETE queries on FieldNote images

To use basic features check FieldNotesHelper.java class.

Here are three very important parts

  • static classes that contain names of possible field notes columns. These are used in all specific requests.
  • static helper functions for basic operations over content provider. Of course you may write your own functions if you require more specific requests.
  • static functions for some other tasks. For example requests on “log certain field notes over Groundspeak Live API”.

Sample call

int count = FieldNotesHelper.getCount(context, lv);

In this basic call, where you get information about number of existing field notes, you need only two things.

  1. current active context
  2. LocusVersion object, which is already described in our basics here
Clone this wiki locally