Hi Everyone,
How to create folder during runtime in Android? usually I run external command to do this, but I don't know what command to run in Android.
Thanks in advance,
-iip-
how to create folder during runtime in android?
-
- Posts: 68
- Joined: August 25th, 2013, 1:21 am
Re: how to create folder during runtime in android?
I am creating folder via pff. example below:
PROC GLOBAL
Alpha (50) pffFileName="efs.pff";
Alpha (60) applicationName;
string datafileName;
file pffFile;
PROC MENU
PostProc
if $=1 then
applicationName="..\Household\EFS hhd qnre v1.ent";
datafileName=concat("..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
elseif $=2 then
applicationName="..\Child\EFS CHILD v1.ent";
datafileName=concat("..\data file\CHILD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
elseif $=3 then
applicationName="..\Child Assessment\assessment v1.ent";
datafileName=concat("..\data file\ASSESSMENT_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
else
errmsg (".... wrong selection");
reenter;
endif;
setfile (pffFile, strip(pffFileName),create);
filewrite (pffFile, "[Run Information]");
filewrite (pffFile, "version=CSPro 5.0");
filewrite (pffFile, "appType=entry");
filewrite (pffFile, "[dataEntryInit]");
filewrite (pffFile, "Interactive=Ask");
filewrite (pffFile, "OperatorID=%d", INTERVR);
filewrite (pffFile, "startmode=add");
// filewrite (pffFile, "Fullscreen=Yes");
filewrite (pffFile, "[Files]");
filewrite (pffFile, "Application=%s", strip(applicationName));
filewrite (pffFile, "InputData=%s", dataFileName);
if $ = 1 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
endif;
if $ = 2 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
filewrite (pffFile, concat("HHD_DICT=..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat"));
endif;
if $ = 3 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
filewrite (pffFile, concat("HHD_DICT=..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat"));
endif;
Close (pffFile);
execpff (strip(pffFileName),wait);
fileCopy (maketext("%s", strip(dataFileName)),maketext("%s-BACKUP-%d", strip(dataFileName),sysdate("YYYYMMDD")));
Stop (1);
PROC GLOBAL
Alpha (50) pffFileName="efs.pff";
Alpha (60) applicationName;
string datafileName;
file pffFile;
PROC MENU
PostProc
if $=1 then
applicationName="..\Household\EFS hhd qnre v1.ent";
datafileName=concat("..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
elseif $=2 then
applicationName="..\Child\EFS CHILD v1.ent";
datafileName=concat("..\data file\CHILD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
elseif $=3 then
applicationName="..\Child Assessment\assessment v1.ent";
datafileName=concat("..\data file\ASSESSMENT_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat");
else
errmsg (".... wrong selection");
reenter;
endif;
setfile (pffFile, strip(pffFileName),create);
filewrite (pffFile, "[Run Information]");
filewrite (pffFile, "version=CSPro 5.0");
filewrite (pffFile, "appType=entry");
filewrite (pffFile, "[dataEntryInit]");
filewrite (pffFile, "Interactive=Ask");
filewrite (pffFile, "OperatorID=%d", INTERVR);
filewrite (pffFile, "startmode=add");
// filewrite (pffFile, "Fullscreen=Yes");
filewrite (pffFile, "[Files]");
filewrite (pffFile, "Application=%s", strip(applicationName));
filewrite (pffFile, "InputData=%s", dataFileName);
if $ = 1 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
endif;
if $ = 2 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
filewrite (pffFile, concat("HHD_DICT=..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat"));
endif;
if $ = 3 then
filewrite (pffFile, "[ExternalFiles]");
filewrite (pffFile, "PSU_CODES_DICT=..\Lookup DATA\List of grids.prn");
filewrite (pffFile, "HHD_CODES_DICT=..\Lookup DATA\List of Families.prn");
filewrite (pffFile, "MEM_DICT=..\Lookup DATA\List of hhd members.prn");
filewrite (pffFile, concat("HHD_DICT=..\data file\HHD_",edit("9",DISTRICT),edit("99",UC),edit("999",PSU),edit("999999",HHD),".dat"));
endif;
Close (pffFile);
execpff (strip(pffFileName),wait);
fileCopy (maketext("%s", strip(dataFileName)),maketext("%s-BACKUP-%d", strip(dataFileName),sysdate("YYYYMMDD")));
Stop (1);
Re: how to create folder during runtime in android?
Hi Shafiq,
Thank you for sharing an example, I will try it.
Best,
-iip-
Thank you for sharing an example, I will try it.
Best,
-iip-
Re: how to create folder during runtime in android?
Hi Shafiq,
I try to create similar simple program, but it seem not able to create folder on the fly in csentry, here is the error :
,
Which folder in your program that created while running csentry?
Best,
-iip-
I try to create similar simple program, but it seem not able to create folder on the fly in csentry, here is the error :
,
Which folder in your program that created while running csentry?
Best,
-iip-