Call DiskSyncTask from third party app?

Hi,

In our mesh based system I have a need to add / delete forms that ODK
Collect will use outside the standard ODK Collect based workflow.

For example there won't be a valid Internet connection for ODK Collect
to download new forms. However an application I'm working on can
receive new forms via out mesh network and put them into the right
place for ODK Collect to find / use them.

I see that there is a DiskSyncTask[1] class which updates the ODK
Collect internal database with forms which have been added to the ODK
directory manually.

I see that it is called by the "FormChooserList" activity. However I'd
rather not have any ODK Collect UI display at the time that the update
occurs.

Is there any other way that a third party app could call this task?
I've had a quick look but couldn't see anything.

If there isn't, I'm wondering if you would be adverse to a patch that
contained an IntentService which could be called by a third party app
which started this task.

I would envisage an app that wished to call this task would also need
to declare the use of an appropriate ODK Collect related permission.

With thanks.

-Corey

[1] http://code.google.com/p/opendatakit/source/browse/src/org/odk/collect/android/tasks/DiskSyncTask.java?repo=collect

If you want to insert/register a form into ODK Collect, you should use the
Forms ContentProvider to insert the form.
Similarly, if you want to construct a partially-filled-out instance and
register it, you would use the Instances ContentProvider.

https://groups.google.com/forum/?fromgroups=#!searchin/opendatakit-developers/contentProvider/opendatakit-developers/6sJPIvZK3AA/01_gYr0X6pwJ

Mitch

This immediately inserts it and obviates the need for the DiskSyncTask to
find it and pick it up. The later was developed to handle the use case
where people manually copy forms onto the phone then expect ODK Collect to
find them.

ยทยทยท On Sat, Jan 26, 2013 at 4:24 AM, Corey Wallis wrote:

Hi,

In our mesh based system I have a need to add / delete forms that ODK
Collect will use outside the standard ODK Collect based workflow.

For example there won't be a valid Internet connection for ODK Collect
to download new forms. However an application I'm working on can
receive new forms via out mesh network and put them into the right
place for ODK Collect to find / use them.

I see that there is a DiskSyncTask[1] class which updates the ODK
Collect internal database with forms which have been added to the ODK
directory manually.

I see that it is called by the "FormChooserList" activity. However I'd
rather not have any ODK Collect UI display at the time that the update
occurs.

Is there any other way that a third party app could call this task?
I've had a quick look but couldn't see anything.

If there isn't, I'm wondering if you would be adverse to a patch that
contained an IntentService which could be called by a third party app
which started this task.

I would envisage an app that wished to call this task would also need
to declare the use of an appropriate ODK Collect related permission.

With thanks.

-Corey

[1]
http://code.google.com/p/opendatakit/source/browse/src/org/odk/collect/android/tasks/DiskSyncTask.java?repo=collect

--

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