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.
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.
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.
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
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.
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
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 (122.8 KiB) Viewed 7586 times
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:
This means the codes will be duplicated on Windows. If you want to avoid that then you can do this only for Android:
dovarying i = 1until 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); ifgetos() = 10then // 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 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.
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?