Giter Club home page Giter Club logo

ghini.pocket's Introduction

ghini.pocket

ghini.pocket is an Android data viewer and input system. You would find it handy if you want to have a quick idea of a plant species, origin, and date it entered the garden, just by scanning a plant label. It lets you correct data, take pictures, review your inventory, and check spelling and taxonomy derivations of all accepted plant genera.

  • Install ghini.pocket on your android device,
  • Start ghini.pocket,
  • Use ghini.desktop to export your garden database to a reduced SQLite3 database,
  • Copy the reduced database file to the device (this and the previous step you repeat from time to time),

ghini.pocket has one main activity, with four pages: taxonomy review, search, results, and correction. Swipe to move from one to the other. ghini.pocket also has a desktop client activity, with which to pull data from ghini.desktop, or push your updates to the desktop database.

  • While in the search page:
    • scan a plant code (or type it),
    • the interface moves to the right, into the results page,
    • in the results page you see the most relevant details about the plant.
  • While in the results page:
    • follow the link to the relative Wikipedia page,
    • swipe back to the search page,
    • swipe further back to the taxonomy review page,
    • swipe forward to the correction page.
  • In the correction page:
    • you see the data as last exported from ghini.desktop,
    • two buttons also allow you: - grabbing your current coordinates, - taking pictures to be associated to the plant.
    • you click on the field you want to correct,
    • you type the new value,
    • you confirm your edits (which get logged),
    • or you swipe back (and abort your edits).
  • In the taxonomy review page:
    • type a genus name, or its exact initial letters,
    • start the search,
    • the result is the path from genus up to order,
    • multiple matches are possible.
    • type the search item all capitals, and the search will be phonetic.
    • if no genus was found, the search is performed among tribes, then families, then orders.
images/ghini.pocket-0.png images/ghini.pocket-1.png images/ghini.pocket-2.png

the ghini family

and the place of ghini.pocket within the family

images/ghini-family.png

Technical Information

The program is written in Java, and only runs on Android.

There is one MainActivity, composed of several Fragments (at the time of writing it's four Fragments: taxonomy, search, results, collect).

Fragments have the role to manage the view elements, while the Activity implements callbacks, manages the internal state, passes the internal state to Fragments upon activation.

Users staying in the first three Fragments, need not worry about synchronizing with the database. Just consider ghini.pocket as a read only application, periodically export from ghini.desktop to ghini.pocket and you will be fine.

However, ghini.pocket can also be used to collect data to be imported into the ghini.desktop database. This is the role of the CollectFragment.

Consider that anything written in view elements isn't automatically persisted, so when the user swipes left or right to leave a Fragment, all that was written in the Fragment visible elements is lost and will be recovered from the database, according to the last searched plant code.

Speaking in terms of database interaction, getting into a view, that is activating a Fragment, corresponds to begining a transaction. There are two ways to close a transaction, that is either aborting or committing it. To swipe back corresponds to aborting the transaction while to activate the write button corresponds to committing it.

The only Fragment which lets users provide data is the CollectFragment. Consequently, this is the only Fragment that has a confirm button to it.

To handle this, CollectFragment has its own state, that is kept for as long as the Fragment stays active, which is committed to the global state upon confirmation, which is overwritten with the global state when the Fragment becomes active again.

Wherever we have callbacks in the Activity that need read/write access to the corresponding Fragment internal state, we have the Fragment implement FragmentWithState, an interface that exposes the internal Fragment state and offers an updateView method. (Yes, it is cumbersome, and yes, I prefer Python dynamic types, and I wish we could define this all in the XSL gui definition file.)

After you confirm your edits, ghini.pocket will save them in logs and local database, and it will show them as edited, but it will also remind you that you are looking at data containing edits which are local to your handheld device, meaning that what you now see does not necessarily match the central database. Please consider this as an alert: it is you task to import the log file in ghini.desktop, and to again export the database to ghini.pocket.

Pictures taken in the CollectFragment are saved when the user confirms the edits, and are removed and lost together with all other edits if the user swipes back to the ResultFragment, because all references to them are lost when the edits are not persisted in the logs.

The global application state contains all that the user inserted in the visible elements and that was manually persisted. In this, it just reflects the same contents as the ghini.pocket database

ghini.pocket's People

Contributors

aauioo avatar artemmolotov avatar comradekingu avatar eugenia-russell avatar helixcn avatar lizzyd710 avatar mfrasca avatar rezaalmanda avatar santossi avatar szlajozs avatar trendspotter avatar weblate avatar wtuemura avatar xendez avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ghini.pocket's Issues

can we ask new scan from results page?

from the results page, to get to a new result, at the moment you need to go back, ask for a new scan, then search for it.
this is three buttons, and two page changes.
can we do this from the results page directly? just "new scan" and stay on the results page?

update family picture

we should explain that ghini.pocket also produces a (small) stream of information, directly to ghini.desktop.
and you can start odk-collect from ghini.pocket, if you think so.

also show plant location

I know you find the plant physically, so you can see the plant location, but who tells you that the info is correct in the database?

remove randomness from crashes

I have observed random crashes. and random means I've not investigated yet under which circumstances it crashes. so it's possibly several distinct issues.
please investigate!

can't lookup 'next'

did it ever work? from the results page hit 'next' and scan the next code?
we now (1.8) need to go back to the initial page to scan the code.

Generos con el autor, familias

Hablando del panel de corrección e inserción datos:

Me sería muy útil que también al consultar el género me indique a que familia pertenece.

complete taxon table with authorship

at the moment we have a database with 28970 taxa, but not all of them have all the complete authorship information: (rank 0: order; 1: family; 2: subfamily; 3: tribe; 4: subtribe; 5: genus)

sqlite> select rank, count(*) from taxon f group by rank;
0|68
1|1388
2|348
3|240
5|26926
sqlite> select rank, count(*) from taxon f where f.authorship is null group by rank ;
1|899
2|59
3|54

crash while sending pictures

there should be a report on google play, I saw the application try to send 5 pictures, 4Mbytes each, and crash during the task. first time nothing was recorded on the server, second attempt 4 pictures were transferred.

link genera to closest-by super taxon

at the moment most genera are linked to families, even if families have subfamilies and tribes (no subtribe information yet, see #20).
we should be linking genera to the first available above taxon, whatever that might be.

sqlite> select p.rank, c.rank, count(*) from taxon c, taxon p
   ...> where c.parent_id=p.id group by p.rank, c.rank order by c.rank;
0|1|488
1|2|348
2|3|229
1|5|26926

as you see: all families point to order, all subfamilies point to family, all tribes point to subfamily, but then genera point straight into family.

make taxonomic help search similar to collect page

the species editing control in the collect page offers first verbatim matches then phonetic matches, all in the same list. we could generalize this, and offer the same matches also in the taxonomic help page, where currently you only have (partial) verbatim matches.

ghini.pocket_error visualizacion data accesion

From @denadenisse on September 15, 2017 15:56

Mario,
El aplicativo ghini.pocket es muy util, y ha mejorado mucho en este corto periodo de desarrollo. Sin embargo, en algunos dispositivos moviles que usan el aplicativo, al momento de realizar una busqueda, se observa un error de lectura en el campo de familia, donde no se visualiza el nombre como tal de la familia sino la descripcion del contenido de JAVA.
Adjunto una captura de pantalla.

img-20170915-wa0002

Copied from original issue: Ghini/ghini.desktop#274

link to odk-collect

when viewing results, it would be faster if we could move directly to the odk-collect program from there, and even with the option of activating a specific form and copying the accession code to the form.
initially, we could also just put the accession code in the clipboard, so the user can copy it in the form.

review/rethink logging with no location

what should the program do, when a user starts using the program but "forgets" to insert a location code? refuse moving to results page? go to results but warn? not log the action?
I think that the least surprising would be to refuse moving to results page. if the user really wants to work without location, we could add a check (initially unset) that says "do not log", or they could insert a null code. I don't know, I think I would like to discuss it with users.

phonetic search

just like in ghini.web, now that we have a taxonomy search, it would be nice if the search was a bit tolerant of typing mistakes. in ghini.web we have added a phonetic_epithet column, where we keep a reduction of the correct epithet.
noting it down, so we know this should happen sooner or later.

collect data from pocket itself

our first guess about ghini.pocket was that it would only be showing, not collect data. our first guess was to use a odk-collect form to let users collect additional or corrected information.
then we started using ghini.pocket for inventory, and this is a form of collecting data.
so in the end we've already split the streams in two parts, and that's not good.
what about we examine what data we are collecting with odk-collect, and do that with ghini.pocket?

can we have also species epithets?

a request by JBB: when inserting species epithets, they wish to have the complete flora of Colombia in the pocket taxonomy database, so that typing errors would be avoided at the source, instead of corrected after importing in ghini.desktop.
this means doing phonetic match also on the second epithet.

after scan, move directly to results

when you can scan a plant code, what's the point of letting the user click on 'search'?, isn't this always what the user would do? we can skip this step, isn't it?

after entering something in log, put it also in database

when you do not find an accession/plant, and you add it in the log file, you want to also find it in the log, otherwise how are you remember what you did and what you still have to do?
the immediate effect of this would be: when you hit 'save to log', you go back left to the search result, and you see the information you just entered. in practice, the 'save to log' should become 'save', tout court.

You can always decide you want to edit it further, and go back to the editing pane and correct. This would generate two log entries and alter the same database record.

complete taxon information with subtribes

at the moment we have a database with 28970 taxa, but not all of them have all the complete authorship information: (rank 0: order; 1: family; 2: subfamily; 3: tribe; 4: subtribe; 5: genus) - as you see, 4 is empty.

sqlite> select rank, count(*) from taxon f group by rank;
0|68
1|1388
2|348
3|240
5|26926

put back the link to odk-collect

in the first ghini.pocket version, we could go to odk-collect and take pics, or correct information. most of all, it was taking pictures what was most interesting, and most complex
Unfortunately, the whole data stream towards the ghini.desktop database hasn't been completed, it's still at the stage of a script doing the job and users having to trust that all that happens is correct.
I think it would be easier if we did not need go through the external odk-aggregate server, but yet, at the moment we have no other option, and I've only removed a functionality without replacing it with something better. That's not good.

build on Travis-CI

File /home/travis/.android/repositories.cfg could not be loaded.

Checking the license for package Android SDK Build-Tools 26 in /usr/local/android-sdk/licenses

Warning: License for package Android SDK Build-Tools 26 not accepted.

FAILURE: Build failed with an exception.

* What went wrong:

A problem occurred configuring project ':app'.

> You have not accepted the license agreements of the following SDK components:

  [Android SDK Build-Tools 26].

  Before building your project, you need to accept the license agreements and complete
  the installation of the missing components using the Android Studio SDK Manager.

ask for GPS permission rather than crash

crash report from one of our users

Package Name: me.ghini.pocket
Crash Report Date And Time: 2018-04-16T21:39:41Z
Exception Message: Attempt to invoke virtual method 'android.location.Location android.location.LocationManager.getLastKnownLocation(java.lang.String)' on a null object reference
Throwing Class Name: me.ghini.pocket.MainActivity
Throwing Method Name: onCollectSaveToLog

keep history of searches

maybe useful: keep a history of the plants that the user has looked up since starting up the program.
so when user goes back to desk, can review what was in the garden and may notice missing plants.

review behaviour of look-up without code

para activar la búsqueda del código de planta insertado, lo puedes hacer de dos maneras diferentes.

  • oprimiendo la tecla search
  • haciendo swipe a la derecha.

si no insertaste el código de planta, el primer método te avisa y no pasa a la pantalla siguiente, sin embargo el segundo método te lleva a la pantalla de resultados, que no es correcto.

more detailed usage description

we need a more detailed usage description, and should we keep it here in the README or should it go in the ghini.desktop documentation, where everything starts and we can also have it translated.

it's too easy to delete all search history

you type a location code, and automatically, you hit the key next to the text entry. all history gone.
what about letting the user delete these files manually, and just have the button rename the current log to something else, timestamped? sounds a lot safer.

add labels to data

the result page holds the information, but it does not state what each field represents.
maybe it's obvious and not needed, maybe better be explicit, I'm not sure, just noting it here as a doubt.

add taxonomy browser

it would be nice to have something that would tell you the higher taxa epithets, given a genus. or given a partial genus, tell you the possible matches. also nice, if it would be able to correct spelling mistakes, like the ones we neo-latins always make, typing ritmo when we really need rhythmus. this part isn't difficult at all and it's already implemented in ghini.web.
back to what there is to do, I think I have to restructure ghini.pocket, build it on a single activity and three fragments, when we now have two activities. it's a bit of work and quite a bit of rewriting and since I still feel as a complete outsider in Android, I guess this is going to keep me busy for longer than a couple of days.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.