How to sync and send all surveys on DropBox

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Post Reply
ctpacheco
Posts: 3
Joined: November 10th, 2021, 8:11 am
Location: Rio de Janeiro - Brazil

How to sync and send all surveys on DropBox

Post by ctpacheco »

HI
My name is Carlos
I'm developing an application in CSPro 7.6 to run on Tablet.
I'm using DROPBOX to do the synchronism.
It's all OK.
Only when I send the .dat file, only the latest updates come, or rather I read that the synchronization always sends new and changed surveys to the DropBox server.

I would like if possible that whenever the person using it sends all the questionnaires.

I'm using the following code (There are four tablets, so I used these different ways to send them to dropbox:

if syncconnect(Dropbox) = 1 then
if COD_ENT_W=1 then
syncfile(PUT,"/storage/emulated/0/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_1\Dados\jauari.dat");
endif;
if COD_ENT_W=2 then
syncfile(PUT,"/storage/emulated/0/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_2\Dados\jauari.dat");
endif;
if COD_ENT_W=3 then
syncfile(PUT,"/storage/emulated/0/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_3\Dados\jauari.dat");
endif;
if COD_ENT_W=4 then
syncfile(PUT,"/storage/emulated/0/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_4\Dados\jauari.dat");
endif;
ctpacheco
Posts: 3
Joined: November 10th, 2021, 8:11 am
Location: Rio de Janeiro - Brazil

Re: How to sync and send all surveys on DropBox

Post by ctpacheco »

Hi
My name is Carlos.
I am developing an application and I need to send the completed questionnaires using dropbox.
Hey read that only new and changed questionnaires are sent.
Not all surveys (the entire .dat file) are sent
I would like to know if there is a way to always sync send the complete .dat file?

Another question, I didn't find a way to differentiate the files with the date or time of transmission or put the username.

Below the transmission code, there are four different tablets so I created four folders in the dropbox to receive:

I appreciate any help
Thank you very much
Carlos T Pacheco
============================================
if syncconnect(Dropbox) = 1 then

if COD_ENT_W=1 then
syncfile(PUT,"/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_1\Dados\jauari.dat");
endif;

if COD_ENT_W=2 then
syncfile(PUT,"/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_2\Dados\jauari.dat");
endif;

if COD_ENT_W=3 then

syncfile(PUT,"/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_3\Dados\jauari.dat");
endif;

if COD_ENT_W=4 then
syncfile(PUT,"/Android/data/gov.census.cspro.csentry/files/csentry/Dados/Jauari.dat","\Tablet_4\Dados\jauari.dat");
endif;

syncdisconnect();

endif;
end;
aaronw
Posts: 565
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: How to sync and send all surveys on DropBox

Post by aaronw »

When using syncdata on a CSDB file only changes are synchronized. However, you're using syncfile with a DAT file, so the entire file will be sent every time you synchronize (which sounds like the functionality you want). I recommend using pathconcat with the application argument, so you don't need to hardcode the path (can vary depending on tablet). https://www.csprousers.org/help/CSPro/p ... ction.html

You could include staff code in the questionnaire and have the enumerator enter their code/name when they begin the application.
Post Reply