3rd party app results and relevance

I'm guessing there isn't an easy solution to this, but thought I would
throw it out there just in case.

We are launching a system whereby collected samples are labelled in a very
specific, but sequential manner (for the purposes of explanation, assume
the numbering goes 1 2 3 etc). To generate the label, we created a small
3rd party app that is launched from Collect. Because data can not be passed
from Collect to the app we wanted to ensure that users couldn't get one
number and then accidentally trigger the app again and get a second number.
To prevent this happening, the app will only issue a new id once 5 mins has
elapsed - this ensures they can't accidentally trigger the app twice in
quick succession and end up with e.g. number 8 rather than number 7.
However I also wanted to ensure that in case they go back in the form (ie
after 5 mins has elapsed) the app launcher would not be visible. I
therefore set it to be relevant only if another later question was empty.
The flow therefore looks like this:

  1. Label generation question - Only relevant if result is empty
  2. Calculate field to combine other fields and label generation question
  3. Note field to show the label that should be recorded on the sample
  4. Result - Result of sample

This all works perfectly well, however as soon as one answers the result
question (4), the label generation question (1) field is deemed not
relevent and the id is lost, meaning that the note field (3) loses part of
its value. Has anyone got any suggestions for how I might get round this?
Attached is a small example of the form...

Happy to clarify if that wasn't clear.

TestCounterApp.xml (2.52 KB)

If you can build a custom ODK Collect, I just modified the 3rd party app
widgets so that they include a "value" extra that specifies the current
value of the field. This should solve your problem.

The change has been pushed up to the repository. It will be in the next ODK
Collect update (no ETA on that).

Mitch

··· On Wed, May 15, 2013 at 5:45 AM, dj_bridges wrote:

I'm guessing there isn't an easy solution to this, but thought I would
throw it out there just in case.

We are launching a system whereby collected samples are labelled in a very
specific, but sequential manner (for the purposes of explanation, assume
the numbering goes 1 2 3 etc). To generate the label, we created a small
3rd party app that is launched from Collect. Because data can not be passed
from Collect to the app we wanted to ensure that users couldn't get one
number and then accidentally trigger the app again and get a second number.
To prevent this happening, the app will only issue a new id once 5 mins has
elapsed - this ensures they can't accidentally trigger the app twice in
quick succession and end up with e.g. number 8 rather than number 7.
However I also wanted to ensure that in case they go back in the form (ie
after 5 mins has elapsed) the app launcher would not be visible. I
therefore set it to be relevant only if another later question was empty.
The flow therefore looks like this:

  1. Label generation question - Only relevant if result is empty
  2. Calculate field to combine other fields and label generation
    question
  3. Note field to show the label that should be recorded on the sample
  4. Result - Result of sample

This all works perfectly well, however as soon as one answers the result
question (4), the label generation question (1) field is deemed not
relevent and the id is lost, meaning that the note field (3) loses part of
its value. Has anyone got any suggestions for how I might get round this?
Attached is a small example of the form...

Happy to clarify if that wasn't clear.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Mitch,

Thanks for your response. I'm afraid I am not an android developer so i
can't roll a custom ODK. Fortunately I know some people who can, but
they aren't so familiar with the ODK Collect source code. Apologies if
these are stupid questions, but...

  1. Is it just a matter of downloading the source from
    http://code.google.com/p/opendatakit/source/checkout?repo=collect
    and building the apk? I can see the change that you committed
  2. What code is needed in the .xml to pass the value to the 3rd party app?

Thanks so much for committing the change!

Cheers
Dan

··· On 15/05/13 22:51, Mitch Sundt wrote: > If you can build a custom ODK Collect, I just modified the 3rd party > app widgets so that they include a "value" extra that specifies the > current value of the field. This should solve your problem. > > The change has been pushed up to the repository. It will be in the > next ODK Collect update (no ETA on that). > > Mitch > > > > On Wed, May 15, 2013 at 5:45 AM, dj_bridges <danieljbridges@gmail.com > wrote: > > I'm guessing there isn't an easy solution to this, but thought I > would throw it out there just in case. > > We are launching a system whereby collected samples are labelled > in a very specific, but sequential manner (for the purposes of > explanation, assume the numbering goes 1 2 3 etc). To generate the > label, we created a small 3rd party app that is launched from > Collect. Because data can not be passed from Collect to the app we > wanted to ensure that users couldn't get one number and then > accidentally trigger the app again and get a second number. To > prevent this happening, the app will only issue a new id once 5 > mins has elapsed - this ensures they can't accidentally trigger > the app twice in quick succession and end up with e.g. number 8 > rather than number 7. However I also wanted to ensure that in case > they go back in the form (ie after 5 mins has elapsed) the app > launcher would not be visible. I therefore set it to be relevant > only if another later question was empty. The flow therefore looks > like this: > > 1. Label generation question - Only relevant if result is empty > 2. Calculate field to combine other fields and label generation > question > 3. Note field to show the label that should be recorded on the sample > 4. Result - Result of sample > > > This all works perfectly well, however as soon as one answers the > result question (4), the label generation question (1) field is > deemed not relevent and the id is lost, meaning that the note > field (3) loses part of its value. Has anyone got any suggestions > for how I might get round this? Attached is a small example of the > form... > > Happy to clarify if that wasn't clear. > -- > -- > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to the Google > Groups "ODK Community" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to opendatakit+unsubscribe@googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > > > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitchellsundt@gmail.com > -- > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to a topic in the > Google Groups "ODK Community" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/opendatakit/2SwDQo82hJo/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > opendatakit+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >

This may be helpful for your developer:
http://code.google.com/p/opendatakit/wiki/DevelopmentEnvironment
The build you make won't be signed, or your developer will need to sign it
with your own key.

There is no XML change. The current value of the field is simply passed to
the 3rd party app in the 'vallue' extra. It will either be null (no value)
or have a value (i.e., a String, Integer or Double).

Mitch

··· On Wed, May 15, 2013 at 11:21 PM, Daniel Bridges wrote:

Mitch,

Thanks for your response. I'm afraid I am not an android developer so i
can't roll a custom ODK. Fortunately I know some people who can, but they
aren't so familiar with the ODK Collect source code. Apologies if these are
stupid questions, but...

  1. Is it just a matter of downloading the source from
    http://code.google.com/p/opendatakit/source/checkout?repo=collect and
    building the apk? I can see the change that you committed
  2. What code is needed in the .xml to pass the value to the 3rd party
    app?

Thanks so much for committing the change!

Cheers
Dan
On 15/05/13 22:51, Mitch Sundt wrote:

If you can build a custom ODK Collect, I just modified the 3rd party app
widgets so that they include a "value" extra that specifies the current
value of the field. This should solve your problem.

The change has been pushed up to the repository. It will be in the next
ODK Collect update (no ETA on that).

Mitch

On Wed, May 15, 2013 at 5:45 AM, dj_bridges danieljbridges@gmail.comwrote:

I'm guessing there isn't an easy solution to this, but thought I would
throw it out there just in case.

We are launching a system whereby collected samples are labelled in a
very specific, but sequential manner (for the purposes of explanation,
assume the numbering goes 1 2 3 etc). To generate the label, we created a
small 3rd party app that is launched from Collect. Because data can not be
passed from Collect to the app we wanted to ensure that users couldn't get
one number and then accidentally trigger the app again and get a second
number. To prevent this happening, the app will only issue a new id once 5
mins has elapsed - this ensures they can't accidentally trigger the app
twice in quick succession and end up with e.g. number 8 rather than number
7. However I also wanted to ensure that in case they go back in the form
(ie after 5 mins has elapsed) the app launcher would not be visible. I
therefore set it to be relevant only if another later question was empty.
The flow therefore looks like this:

  1. Label generation question - Only relevant if result is empty
  2. Calculate field to combine other fields and label generation
    question
  3. Note field to show the label that should be recorded on the sample
  4. Result - Result of sample

This all works perfectly well, however as soon as one answers the result
question (4), the label generation question (1) field is deemed not
relevent and the id is lost, meaning that the note field (3) loses part of
its value. Has anyone got any suggestions for how I might get round this?
Attached is a small example of the form...

Happy to clarify if that wasn't clear.

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/2SwDQo82hJo/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Mitch,

Thanks so much for all your help. Our version built from source is working
perfectly.

Cheers
Dan

Hi Mitch,

I have downloaded ODK Collect project (zip from repository) its loaded in the eclipse, can you guide where to make changes from 3rd party app communication with ODK collect, any guidance on this would be really helpful.

Regards

For an example of such a 3rd party app, see
http://code.google.com/p/opendatakit/source/browse?repo=androidextras

which is an App that can be invoked from Collect. The breathTest.xml in
that repository is an example form demonstrating how to launch this app
from within Collect.

There are no modifications necessary to ODK Collect itself, unless you want
to pass additional arguments to that app.

··· On Wed, Dec 4, 2013 at 11:59 PM, wrote:

Hi Mitch,

I have downloaded ODK Collect project (zip from repository) its loaded in
the eclipse, can you guide where to make changes from 3rd party app
communication with ODK collect, any guidance on this would be really
helpful.

Regards

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Hi Mitch,

Thank you, that was very helpful, for now :slight_smile:

Regards