Challenges with Syncing on Android devices

Discussions about creating CAPI applications to run on Android devices
Post Reply
Jay
Posts: 6
Joined: February 16th, 2024, 11:26 am

Challenges with Syncing on Android devices

Post 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;
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Challenges with Syncing on Android devices

Post 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
Jay
Posts: 6
Joined: February 16th, 2024, 11:26 am

Re: Challenges with Syncing on Android devices

Post by Jay »

Thank you @ justinlakier. Please I'll do that to see if it'll change.
Post Reply