Dropbox Sync

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Dropbox Sync

Post 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 316 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.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dropbox Sync

Post 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.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Dropbox Sync

Post 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 310 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dropbox Sync

Post 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.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Dropbox Sync

Post 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 314 times
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Dropbox Sync

Post 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 7157 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Dropbox Sync

Post 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;
sah
Posts: 97
Joined: May 28th, 2015, 3:16 pm

Re: Dropbox Sync

Post 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.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Dropbox Sync

Post 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
Abel
Posts: 6
Joined: July 26th, 2017, 10:02 am

Re: Dropbox Sync

Post 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?
Post Reply