File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Boni
Posts: 75
Joined: February 25th, 2020, 5:53 am

File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by Boni »

Dear Gentlemen !!!

I'm working on a statistical data collection system with CSPRO. The system consists of household and individual data collection applications and a menu (IntMenu) for interviewers, a household assignment application used by the Supervisor with its menu (SupMenu). I use Dropbox for synchronization of supervisor with the server and Bluetooth between the supervisor and interviewers.
My concerns are as follows:


1) The names of the assignment files consist of the letter "S" followed by the cluster number concerned. I want that, when transferring the supervisor to an interviewer, when the interviewer seizes "0001" as a cluster number in its menu (IntMenu) before starting the recovery program of the assignment file by Bluetooth, the system recovers the file "S0001" (".dat" in extension) according to a specified path. I wrote a program that seems to be just but it does not work, the program sends an error message: the file "work / S0001.dat" is not found (for example), although the file is indeed in the indicated file.


2) Same problem to send from Supervisor device the file using the number of the cluster as the name of the file to send to the server.



3) When I sync data on Dropbox data, the data file does not stay in the desired folder. The program does not take into account the path indicated for the server.



4)
My last concern: once assignments received by an interviewer, the next step is to start the collection. The assignment file would be external file to the PFF program, when the interviewer works in the cluster 1, the external file assignment would be "S0001.Dat". So my problem is how to proceed for this file to be changed whenever the cluster entered in the interviewer menu is changed. For example, if the interviewer enters the cluster number box in the menu, "0002", the external assignment file that was "S0001.DAT" is changed in "S0002.DAT".
Last edited by Boni on May 31st, 2020, 8:39 am, edited 1 time in total.
Sincerely yours !
Boni
Posts: 75
Joined: February 25th, 2020, 5:53 am

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by Boni »

Boni wrote: February 27th, 2020, 7:51 pm Dear Gentlemen !!!

I'm working on a statistical data collection system with CSPRO. The system consists of household and individual data collection applications and a menu (IntMenu) for interviewers, a household assignment application used by the Supervisor with its menu (SupMenu). I use Dropbox for synchronization of supervisor with the server and Bluetooth between the supervisor and interviewers.
My concerns are as follows:


1) The names of the assignment files consist of the letter "S" followed by the cluster number concerned. I want that, when transferring the supervisor to an interviewer, when the interviewer seizes "0001" as a cluster number in its menu (IntMenu) before starting the recovery program of the assignment file by Bluetooth, the system recovers the file "S0001" (".dat" in extension) according to a specified path. I wrote a program that seems to be just but it does not work, the program sends an error message: the file "work / S0001.dat" is not found (for example), although the file is indeed in the indicated file.


2) Same problem to send from Supervisor device the file using the number of the cluster as the name of the file to send to the server.



3) When I sync data on Dropbox data, the data file does not stay in the desired folder. The program does not take into account the path indicated for the server.



4)
My last concern: once assignments received by an interviewer, the next step is to start the collection. The assignment file would be external file to the PFF program, when the interviewer works in the cluster 1, the external file assignment would be "S0001.Dat". So my problem is how to proceed for this file to be changed whenever the cluster entered in the interviewer menu is changed. For example, if the interviewer enters the cluster number box in the menu, "0002", the external assignment file that was "S0001.DAT" is changed in "S0002.DAT".
Attachments
Declaration
Declaration
fdata(2).PNG (4.37 KiB) Viewed 3509 times
Declaration
Declaration
AssignFile(1).PNG (2.49 KiB) Viewed 3509 times
Last edited by Boni on May 31st, 2020, 8:42 am, edited 1 time in total.
Sincerely yours !
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by josh »

You are mixing the old pnc file based sync which is no longer supported with the sync logic functions (syncconnect, syncfile...). You should not be using PNC files. Please take a look at the chapter on synchronization in the workshop materials. They will help you understand how to use these functions.

https://www.csprousers.org/resources/CS ... rkshop.pdf
https://www.csprousers.org/resources/Fr ... rkshop.pdf

To change the data file based on the cluster you can use the setfile() function. For example:

Code: Select all

string assignment_file_name = maketext("s%04d.DAT", CLUSTER_NUMBER);
setfile(ASSIGNMENT_DICT, assignment_file_name );
Boni
Posts: 75
Joined: February 25th, 2020, 5:53 am

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by Boni »

Thank you for your prompt reaction!!!
I had finished by finding solutions. Only Point 4 (Change the data file basée on the Cluster) to which I have not yet found any solution on Android, it works properly on computer with the "Setfile" function, but on Android I still do not yet. But with these files you just sent me, I should be able to get out. They will be of great use to me, especially the one who is in French :lol: . Thank you so much!!!
Sincerely yours !
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by josh »

If it works on the PC and not on Android it is most likely a problem with the path to the file.
Boni
Posts: 75
Joined: February 25th, 2020, 5:53 am

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by Boni »

Dear Sir !!!!
In fact, the function "setfile" also walks on my Android. My concern now is that my system can not load the external file in question and then display its content to allow the interviewer to select the assigned household. In other words, I have a concern with the "Selcase" function on Android if I'm not mistaken . Yet the same program works correctly on the PC.
Thank you for your help !
Last edited by Boni on May 31st, 2020, 8:47 am, edited 1 time in total.
Sincerely yours !
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: File synchronization (appointed by the cluster number) by Bluetooth and Dropbox

Post by josh »

Did you copy the data file that corresponds to ASSIGNMENT_DICT to the Android device?

If that isn't the problem then you should post the application and detailed instructions on how to reproduce the problem. It is impossible to tell what the problem could be from just a code snippet.
Post Reply