Page 4 of 5

Re: Dropbox Sync

Posted: August 1st, 2017, 3:10 pm
by arkagwa
Dear Josh

I have another idea,I copy the external dictionary (UG Lookup.dcf) into the Main folder and create the lookup.dat inside this main folder. Then i add the external dictionary into the main UG Form dictionary. This means that the Pen file will recognize also the external dictionary and lookup.dat. this means i will not need resource folder and dropsync will also update the lookup.dat file to android devices as well as other PCS.

See attached modified Form
UG FORM.zip
(44.06 KiB) Downloaded 324 times

josh wrote:You only need the pen and pff file. If you create a resource folder and put your lookup file inside the resource folder then the lookup file gets added to the pen file when you publish the pen file. The pen file is kind of like a zip file. When you run the pen file on your device the resources folder and all of its contents are extracted from the pen file onto the tablet.

Re: Dropbox Sync

Posted: August 1st, 2017, 10:50 pm
by josh
That doesn't sound like it will work to me. The lookup file will only be added to the pen file if it is in the resource folder. The location of the dictionary doesn't matter. Just make a resource folder, put your lookup file in it, run the app and choose the lookup file that is in the resource folder. Publish your app and copy pff and pen to the tablet and you are done.

Re: Dropbox Sync

Posted: August 2nd, 2017, 8:01 am
by arkagwa
josh wrote:That doesn't sound like it will work to me. The lookup file will only be added to the pen file if it is in the resource folder. The location of the dictionary doesn't matter. Just make a resource folder, put your lookup file in it, run the app and choose the lookup file that is in the resource folder. Publish your app and copy pff and pen to the tablet and you are done.
Dear Josh

Did not work i am confused, course code does not pick from lookup file

Attached latest CAPI
UG FORM.zip
(46.04 KiB) Downloaded 321 times

Re: Dropbox Sync

Posted: August 2nd, 2017, 8:44 am
by josh
The app you posted is trying to use the lookup file in the old location. You need to tell it to use the one in the resource folder. Run the app on Windows, in the file associations dialog that comes up click on the "..." in the second row (External file UG_LOOKUP) and browse to the new data file location that is in the resource folder. This will modify the path to the lookup in the pff file.

Re: Dropbox Sync

Posted: August 2nd, 2017, 10:22 am
by arkagwa
josh wrote:The app you posted is trying to use the lookup file in the old location. You need to tell it to use the one in the resource folder. Run the app on Windows, in the file associations dialog that comes up click on the "..." in the second row (External file UG_LOOKUP) and browse to the new data file location that is in the resource folder. This will modify the path to the lookup in the pff file.
Dear Josh

I have failed completely, i have done what you said does not work. It seems UG lookup dict. inside UG form is forcing to pick data file within the UG form instead of external resource folder "UG LOOKUP" where i used to build ut UG lookup.dat

Look at the file again
UG FORM.zip
(45.83 KiB) Downloaded 324 times

Re: Dropbox Sync

Posted: August 2nd, 2017, 10:55 am
by arkagwa
Dear Josh

I edited .pff file with notepad++ now working fine. Thanks.

But i am not happy with display in android device, i can only see course titles instead of course codes, although when i select the tile the corresponding course code is captured.[setvalueset(COURSE_CODE, aCourseCodes, aCourseTitles);]

I doubt on screen size might be the problem.
Screenshot_2017-08-02-17-48-11[1].png
Screenshot_2017-08-02-17-48-11[1].png (122.8 KiB) Viewed 7269 times

Re: Dropbox Sync

Posted: August 2nd, 2017, 11:45 am
by josh
On Android we don't display the codes of a value set, only the labels. This is because is most cases when doing CAPI the codes don't matter (for example codes for variables like gender or relationship). In the next version we will have an option to show both codes and labels on Android.

In your case I would just add the codes into the course titles:
        aCourseTitles(i) = maketext("%s %s", COURSE_CODE_LOOKUP(i), COURSE_TITLE_LOOKUP(i));
This means the codes will be duplicated on Windows. If you want to avoid that then you can do this only for Android:
    do varying i = 1 until i > count(UG_LOOKUP_DICT.UG_LOOKUP_REC)
        
{ the arrays that we use for setvalueset start at 1 so we use i! }
        aCourseNumbers(i) = COURSE_LOOKUP(i);
        aCourseCodes(i) = COURSE_CODE_LOOKUP(i);
        
if getos() = 10 then
            
// Windows
            aCourseTitles(i) = COURSE_TITLE_LOOKUP(i);
        
else
            
// Android - include code in value set label
            aCourseTitles(i) = maketext("%s %s", COURSE_CODE_LOOKUP(i), COURSE_TITLE_LOOKUP(i));
        
endif;
    
enddo;

Re: Dropbox Sync

Posted: August 2nd, 2017, 3:30 pm
by sah
I think, using the other option such as the comb box or drop down shows the codes. Just have to change the field property and your codes will show.

Re: Dropbox Sync

Posted: August 3rd, 2017, 4:08 am
by arkagwa
sah wrote:I think, using the other option such as the comb box or drop down shows the codes. Just have to change the field property and your codes will show.
Dear Sab

Thanks for your observation i will check on it

Re: Dropbox Sync

Posted: August 8th, 2017, 3:15 am
by Abel
Abel wrote:
josh wrote:In addition to using the data viewer you can write a CSPro application that uses the sync functions to download from the Dropbox. Just replace the "PUT" with "GET" in the code you have already:

if syncconnect(Dropbox) then
syncdata(GET,MODULE_1_DICT);
syncdata(GET,MODULE2_DICT);
syncdata(GET,MODULE3_DICT);
syncdisconnect();

Just make sure to add those as external dictionaries to your application.

Dear Josh, by replacing the "PUT" by "GET" I get the data from the drop box in csdb format. and it opens in the tablet well. but When I copy the csdb file to my window computer and i try open it is says "Invalid file format. Dictionary is not Valid"
.
What do think will be the problem or how can i solve this?