I am using an example from CSPro 7 for test run and I have found the instructions as follows:
“If running on Android, copy the folder Deployment/Synchronization in Logic to the csentry folder on the Android device.” It means we are going to copy manually in all the devices or is there any quicker way, as we were using "PNC" in the past.
I am using dropbox for my survey with version 7 and file type is text. My syntax is as follows:
Function SynDatatoServer();
if syncconnect(Dropbox) then
syncfile(PUT,"../Work/IND/*.dat","CAPI/Survey/Work/IND/");//First Path is "FROM" and second Path is "TO"
syncfile(PUT,"../Work/HH/*.dat","CAPI/Survey/Work/HH/" ); //First Path is "FROM" and second Path is "TO"
syncfile(PUT,"../Work/COM/*.dat","CAPI/Survey/Work/COM/" ); //First Path is "FROM" and second Path is "TO"
syncdisconnect();
else
endif;
end;
I want to use getdeviceid() and date,time when we are going to upload data on dropbox.
Function SynDatatoServer();
if syncconnect(Dropbox) then
String DateTime=concat (edit("999999",sysdate("DDMMYY")), edit("999999", systime()));
syncfile(PUT,"../Work/IND/*.dat",concat("CAPI/Survey/Work/IND/",getdeviceid(), "/",DateTime,"/") );//First Path is "FROM" and second Path is "TO"
syncfile(PUT,"../Work/HH/*.dat",concat("CAPI/Survey/Work/HH/",getdeviceid(), "/",DateTime,"/" )); //First Path is "FROM" and second Path is "TO"
syncfile(PUT,"../Work/COM/*.dat",concat("CAPI/Survey/Work/COM/", getdeviceid(), "/",DateTime,"/")); //First Path is "FROM" and second Path is "TO"
syncdisconnect();
else
endif;
end;
If there is a better way please advice. Please advice on PNC as well.
thanks.
a.
With the new sync there is currently no way to deploy the application other than via USB. We are working on something but it won't be ready for a little while yet.
What you are doing is a good way to include device id in the path. However, you can now use syncdata() for data files with FTP and Dropbox. With that approach you don't have to worry about interviewers overwriting each others files. You can simply replace the syncfile calls with syncdata calls and then use the DataViewer to download the data from Dropbox into a single csdb file. See "Synchronization Overview" in the help for more info.
127.0.0.1 is the address for localhost. You need the public url of the machine that your CSWeb server is running on. Localhost is a special address that is always a server on the local device so in this case it is looking for a server running on your tablet. Setting up a server with a public URL is beyond what we can help you with. Consult someone with experience in this area or just stick to Dropbox sync.
Setting up a web server that is publicly accessible or accessible over the network is not CSPro specific so I'm not going to help there. Maybe someone else on the forum is willing. Lots of info online as getting your csweb accessible is the same as making any website available over the network. Try Googling stuff like "access local web server from network".
To access to CSPro Web Server through internet, you need to configure and setup your CSWeb Server on a Server Machine that has a Public IP address. That way you can access that server through Internet by the public IP.