Page 1 of 1

Challenges with Syncing on Android devices

Posted: March 1st, 2024, 7:50 pm
by Jay
Hello,
I'm Jay. I have been able to create a CAPI application on CSpro Version 8 and have deployed on android devices via USB. My challenge is this, after completing a case on the enumerator's device, I'm unable to sync data from the enumerator's device unto the supervisors device(Both Android) using bluetooth as the list of bluetooth devices do not even show for selection. Could you help me. I can't seem to identify the problem with the logic and why the bluetooth devices are not showing.

Below are the logics I used for the supervisor and enumerator:

Supervisor:
function syncWithSupervisor();

if syncconnect(bluetooth) = 1 then

// Upload data to supervisor
syncdata(Put, GITS_QUESTIONAIRE_DICT);
syncfile(Put,"./GITSMENU.pff", "./GITSMENU.pff");
syncfile(Put,"./GITSMENU.pen", "./GITSMENU.pen");
syncfile(Put,"./GITS.pff", "./GITS.pff");
syncfile(Put,"./GITS.pen", "./GITS.pen");

syncdisconnect();
errmsg("Sync Complete!");

syncdisconnect();
endif;
end;


Enumerator:
Function syncWithInterviewer();
if syncconnect(bluetooth) = 1 then
// Upload data file to Interviewer
syncdata(Get, GITS_QUESTIONAIRE_DICT);
endif;
syncserver(Bluetooth);
end;

Re: Challenges with Syncing on Android devices

Posted: March 4th, 2024, 9:31 am
by justinlakier
Hello,

When you use SyncServer, it should be called before syncconnect() in order to create the server for the connection. Your syncWithInterviewer() calls syncconnect() before SyncServer, which will cause issues since there is no server yet. Try putting SyncServer first. Also test that your devices can discover each other on BlueTooth correctly without CSEntry.

Hope this helps,
Justin

Re: Challenges with Syncing on Android devices

Posted: March 5th, 2024, 7:20 am
by Jay
Thank you @ justinlakier. Please I'll do that to see if it'll change.