Error in “Employee Search”

dick, created Aug 04. 2016 Hello Mr. Burse! I have tried to run “Employee Search” in Anroid Studio 2.1.2. I got it from "http://www.jekejeke.ch/idatab/doclet/prod/en/docs/05_run/15_stdy/08_deploy/10_mobile/package.html", then attached Prolog interpreter API (Jekejeke Prolog, Runtime Library 1.0.9b, interpreter.zip ) to project. But in Data.java in line: query.callin(consultGoal).nextClose(); took place error "Cannot resolve method callin(consultGoal).nextClose()". Comment in the file Data.java says " @version Jekejeke Prolog 0.9.6 ...", so probably I need Jekejeke Prolog 0.9.6 instead 1.0.9b. If so, could You provide me Jekejeke Prolog 0.9.6 (.apk and .zip)? Yours faithfully, Dmytro Krasnoshapka.

Comments

Re: Error in “Employee Search”

Jan Burse, created Aug 10. 2016 Hi, Cool, congratulations. Bye P.S.: You might notice that initKnowledgebase() takes quite some time. We are working on it to make it faster. It gives the first search a delay. But you can alter the user experience by moving this step to somewhere else, for example when the main activity is created.

Re: Error in “Employee Search”

dick, created Aug 09. 2016 Hi, Mr Burse. Everything is OK, the application runs successfully. Probably the error was caused by Android Studio itself. After the IDE updated the error was gone. File table.p is located in resources. Finally, files in the project are located such way: Thank you! Bye.

Re: Error in “Employee Search”

Jan Burse, created Aug 08. 2016 Hi, Is the runtime error shown on screen? Do you have a Android log cat entry from the runtime error? Could you provide either. The initKnowledgebase() doesn't deal with loading table.p. Its the consultGoal execution that deals with loading table.p. If you place table.p inside a path foo/bar inside the APK. Then the consultGoal should ask for library(foo/bar/table). But it is sometimes tricky to instruct the IDE to include it in the APK. For building with the IDE you have to configure the ending .p as a resource etc.. etc.. You can check the APK whether it has included table.p by temporarily renaming the APK to ZIP and opening it with WinZip or similar. Bye

Re: Error in “Employee Search”

dick, created Aug 05. 2016 Thank you for the answer! I replaced old java files of the project on new files and attached new library (v. 1.1.5), and the error was gone. Application run successfully but when I pressed buttons Search - OK some runtime error appeared and the application shutdown. I found point of the error by debugger: it is line in file Data.java: Knowledgebase.initKnowledgebase(query.getInter()); Firstly I thought that the application cannot find database "table.p". I placed it in all directories of the project but without effect. Well, I will keep trying to solve the problem. Bye!

Re: Error in “Employee Search”

Jan Burse, created Aug 05. 2016 Hi, Unfortunately the ZIP was not up to date. I have uploaded the correct ZIP just now. Try this link http://www.jekejeke.ch/idatab/doclet/prod/en/docs/05_run/15_stdy/08_deploy/package.html again to download the source code of the whole deployment methods study. We recently migrated the examples from Jekejeke Prolog Runtime Library for Android to Jekejeke Prolog 2 Runtime Library for Android. So you should use release 1.1.5 upwards. Which you get from the website here http://www.jekejeke.ch/idatab/doclet/prod/en/docs/05_run/05_down.jsp . Click on "Jekejeke Prolog 2, English and German, Android 2.2 (API 8), Distribution License". Also in some IDEs you need to rename the mobile runtime library from jekejeke.zip to jekejeke.jar otherwise it will not be shipped into the APK. And sadly, for the moment, the new ZIP doesn't match exactly the directory structure you need in the IDE, so you need to move the files manually in their right place. Feel free to ask further questions. Bye