-
Notifications
You must be signed in to change notification settings - Fork 51
How to create android specific .pgf_c binary ? #33
Comments
I have no experience in GF with Android, but is there anything useful in this directory? https://github.com/GrammaticalFramework/GF/tree/master/src/ui/android Maybe @krangelov or @johnjcamilleri could help? |
Yes. I have seen the application in Playstore and saw the android sources in this repository. I have successfully built the JNI and android source. But when reading the source I found that .pgf_c binary needed for each language. So I installed GF 3.9 and successfully build gfo and pgf files, but I nowhere found any documentation for making .pgf_c binary from .pgf binaries.
@krangelov or @aarneranta or @johnjcamilleri any help ? |
@androidsparkling I found it; you need to use the Here is an example:
|
I added a few lines to hopefully make the documentation clearer; you can see the changes here. If you have suggestions how to make it even clearer, or in which other place(s) this information should be available, just let me know and I can add it! |
Great !. Thanks for your help. I can able to build .pgf_c files now.
But I got an error when loading AppHin.pgf. (Tried Bulgarian, Chinese also but same error). See the logs on an Android device,
When I tried Catalan I got the following native error.
|
I've never done anything with Android, but could you try some more basic debugging?
If you don't get answers here, you could post your problem to the gf-dev mailing list. I'm not sure how much @krangelov , @Thomas-H etc. follow GitHub issues. |
I’m not sure if this has reached Krasimir, so let us add his usual mail address.
Inari, you are right that gf-dev would be a good idea, too.
Aarne.
On 19 Apr 2018, at 17:01, Inari Listenmaa <[email protected]<mailto:[email protected]>> wrote:
I've never done anything with Android, but could you try some more basic debugging?
* Is there anything you can do with PGFs that does work? For instance, try the getLanguages() method on the PGF (not .pgf_c).
* Can you try with another grammar? Something really simple, like a Foods grammar<https://github.com/GrammaticalFramework/gf-contrib/blob/master/foods/FoodsEng.gf> with just a single concrete syntax.
* When did you install the C runtime and the Java bindings? There have been quite recent bugfixes, you could check that you have the most up-to-date version.
If you don't get answers here, you could post your problem to the gf-dev mailing list<https://groups.google.com/forum/#!forum/gf-dev>. I'm not sure how much @krangelov<https://github.com/krangelov> , @Thomas-H<https://github.com/Thomas-H> etc. follow GitHub issues.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#33 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACwYXZxq-S9FfqhdyceiA6yoDdiJ_5I_ks5tqKaygaJpZM4TaAng>.
|
The error means that the grammar that you are trying to load doesn't have
these concrete syntaxes.
You can check which languages are available like:
(with the Haskell binding)
$ ghci
:m +PGF2
gr <- readPGF "App.pgf"
languages gr
(with the Python binding)
$ python
… import pgf
gr = pgf.readPGF("App.pgf")
gr.languages
On 19 April 2018 at 13:38, androidsparkling ***@***.***> wrote:
Great !. Thanks for your help. I can able to build .pgf_c files now.
Let me explain what I have done first,
1.
I have converted .gf files from the directory 'GF/examples/app/' using
make command.
2.
After 'make' command executed I could see that there is a new folder
'gfo', the folder contains .gfo files corresponding to the languages. Also,
there are pgf files generated inside the folder 'GF/examples/app/'. Even
though some languages failed to generate the .pgf files.
3.
I have used --split-pgf command to generate .pgf_c file from the .pgf
files and succeeded.
4.
So I have copied App.pgf, AppEng.pgf_c, and AppHin.pgf_c into assets
folder and successfully build and installed on a device.
But I got an error when loading AppHin.pgf. (Tried Bulgarian, Chinese also
but same error). See the logs on an Android device,
Translator: App.pgf loaded (618 ms)
Translator: Trying to load AppEng.pgf_c
Timeline: Timeline: Activity_idle id: ***@***.***
time:26465724
Translator: AppEng.pgf_c loaded (2252 ms)
Translator: Trying to load AppHin.pgf_c
--------- beginning of crash
AndroidRuntime: FATAL EXCEPTION: Thread-3934
Process: org.grammaticalframework.ui.android, PID: 30884
java.lang.NullPointerException: Attempt to invoke virtual method 'void
``org.grammaticalframework.pgf.Concr.load(java.io.InputStream)' on a null
object reference
at org.grammaticalframework.ui.android.Translator$
ConcrLoader.run(Translator.java:720)
When I tried Catalan I got the following native error.
D/Translator: Trying to load AppCat.pgf_c
org.grammaticalframework.ui.android A/libc: Fatal signal 11 (SIGSEGV),
code 1, fault addr 0x0 in tid 15249 (Thread-14094)
org.grammaticalframework.ui.android W/libc: Security Level: (1), Debug
inforamtion is controlled by the DUMPABLE flag.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATBZZGG3smjj9SqIpQSjcoIdcN_Nk-Zgks5tqHdPgaJpZM4TaAng>
.
|
@androidsparkling Did you get it to work? In the Java version, you can use |
I am able to make .pgf file using the make command. But unable to find the tutorial/doc for creating .pgf_c binary from .pgf file.
The text was updated successfully, but these errors were encountered: