Transférer les données sur la clé à partir d'une tablette

Discussions about CSEntry
Post Reply
romain
Posts: 8
Joined: January 3rd, 2013, 8:36 am

Transférer les données sur la clé à partir d'une tablette

Post by romain »

Bonjour

J'aimerai savoir s'il est possible de transférer les données sur une carte mémoire à partir de Csentry pour Android. Ceci en écrivant une procédure adéquate.

Merci

--------------------------------------------------
Hello

I'd like to know if it is possible to transfer data to a memory card from CSEntry for Android. Doing this by writing proper procedure.

Thank you
romain
Posts: 8
Joined: January 3rd, 2013, 8:36 am

Re: Transférer les données sur la clé à partir d'une tablett

Post by romain »

In my case controler are using laptop and interviewer are using tablet.

Thank
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Transférer les données sur la clé à partir d'une tablett

Post by htuser »

Allo,
Tu dois utiliser la fonction filecopy.
Merci
-------------------------------------------------------------
Hi,
Do you alreay try the filecopy function?

Format:

b = filecopy(file-name, result-file-name);
Description:
The filecopy function copies one file to another file, or a group of files to a folder.
The file-name and result-file-name are alphanumeric expressions giving the source and destination file names or names declared in a file statement in PROC GLOBAL.
You can use the wildcard characters "*" and "?" to specify a group of files to copy as the file-name. In that case you must specify the name of a folder as the result-file-name.



Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
romain
Posts: 8
Joined: January 3rd, 2013, 8:36 am

Re: Transférer les données sur la clé à partir d'une tablett

Post by romain »

Merci pour la contribution

J'utilise effectivement la fonction filecopy() de Cspro.
Pratiquement j'ai une syntaxe du genre :



if filecopy(fnames,concat(strip(scard1),"\ECHANTS.dat")) then
errmsg("copie tablette vers sd réalisée avec succès");
else
errmsg("echec copie tablette vers sd");
endif;

if fileexist(concat(strip(scard1),"\EQUIPE.dat")) then
errmsg("fichier existe");
else
errmsg("fichier n'existe pas");
endif;

if filecopy(concat(strip(scard1),"/ECHANTC.dat"),concat(strip(REF),"/ECHANTC.dat")) then
errmsg("copie sd vers tablette réalisée avec succès");
else
errmsg("echec copie sd vers tablette");
endif;

quand je l'execute je reçois "fichier existe" et "copie sd vers tablette réalisée avec succès"; mais j'ai aussi "echec copie tablette vers sd".
Or j'aimerai transferer les données des enquêteurs vers les contrôleurs en utilisant la sdcard.

NB scard1 = "/storage/extSdCard"; (c'est pour indexer la carte sd sur la tablette)
-------------------------------------------------------
thank for your contribution

Yes i realy use the filecopy() function of Cspro.
my syntax look like :

if filecopy(fnames,concat(strip(scard1),"\ECHANTS.dat")) then
errmsg("copie tablette vers sd réalisée avec succès");
else
errmsg("echec copie tablette vers sd");
endif;

if fileexist(concat(strip(scard1),"\EQUIPE.dat")) then
errmsg("fichier existe");
else
errmsg("fichier n'existe pas");
endif;

if filecopy(concat(strip(scard1),"/ECHANTC.dat"),concat(strip(REF),"/ECHANTC.dat")) then
errmsg("copie sd vers tablette réalisée avec succès");
else
errmsg("echec copie sd vers tablette");
endif;

when i execute, i receive "fichier existe" et "copie sd vers tablette réalisée avec succès"; but i also have "echec copie tablette vers sd". in my case i need to transfer data from interviewer to conttroller by using sdcard.
htuser
Posts: 632
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Transférer les données sur la clé à partir d'une tablett

Post by htuser »

Why you don't use Bluetooth sync instead of copy file to SD cards?
G.VOLNY, a CSProuser from Haiti, since 2004
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Transférer les données sur la clé à partir d'une tablett

Post by josh »

Are you using Android version 4.4 or above? In the newer versions of Android they have changed the security model so that applications can longer write to any directory on an external SD card. With Android 4.4 and above an application can create a folder on the SD card in the directory Android/data/gov.census.cspro.csentry/files and then it is allowed to copy files into that directory. Unfortunately CSPro 6.1 does not create this folder but CSPro 6.2 will create it and you will be able to use filecopy to copy files to it.
romain
Posts: 8
Joined: January 3rd, 2013, 8:36 am

Re: Transférer les données sur la clé à partir d'une tablett

Post by romain »

Thank Josh

I'm using android 4.4, but i'm still using Cspro 6.0.1
I will make some test a shared with you.

Best
romain
Posts: 8
Joined: January 3rd, 2013, 8:36 am

Re: Transférer les données sur la clé à partir d'une tablett

Post by romain »

Hi Josh

All my test hasn't give a solution.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Transférer les données sur la clé à partir d'une tablett

Post by josh »

Did you create the directory on the SD card yourself? If you created it yourself then that might cause problems. You should allow CSPro to create the directory for you so that it will be created with the correct permissions. Try deleting the directory, reboot your phone/tablet and then launch CSEntry (the beta version of the .apk file that you download from csprousers.org/beta and install on your tablet/phone). After running CSEntry (you just need to get the first screeen) reboot your phone/tablet again and connect it to the PC and see if the directory was created for you.
Post Reply