GLBasic forum

Main forum => GLBasic - en => Topic started by: Hatonastick on 2011-Nov-01

Title: Android JNI.
Post by: Hatonastick on 2011-Nov-01
Quick question: Does GLB use JNI to compile?  If so, can we access JNI using inline C++?  Asking because I'd like to incorporate Androids Text to Speech engine into a simple game I'm making.

Edit: Guess the answer is to test it myself.  ;/
Title: Re: Android JNI.
Post by: trucidare on 2011-Nov-01
yes and nope - you have to put your c++ code special one into the project structure to get the ant to build it.
Title: Re: Android JNI.
Post by: Hatonastick on 2011-Nov-01
Ok, this sounds awfully close to 'don't bother as it's far too complicated'. :)

Are you saying that I have to add it by hand to the code/project that GLB outputs and sends to the Java compiler when I compile for Android?  Hope my question makes sense.

Edit:  Ahhh I think I found what you are talking about: C:\Program Files (x86)\GLBasic\Compiler\platform\android\android-sdk-windows\platforms\android-8\ant

Edit: Hmm ok that's not it, but I think what you are saying is I'd have to modify something in the compiler in a directory not too far away from the one I listed above.
Title: Re: Android JNI.
Post by: Kitty Hello on 2011-Nov-10
you want to call a Java function from GLBasic?
You might have to write a java file, then call that through the JNI interface. In android/bin, there's the sdl_main.cpp (my C++ interface) and in templateproj/src/glbasic/  there's the main.java file for the Java end. I have no idea how to do that in detail, though.
Title: Re: Android JNI.
Post by: Hatonastick on 2011-Nov-11
I'll look into it.  Maybe.  Depends on how enthused I get.  Java doesn't exactly rate high on my list of 'Languages I like'.  =D

Anyway thanks for giving me somewhere to start.  Prior to that I had no idea, even after poking around in the all directories.
Title: Re: Android JNI.
Post by: mentalthink on 2011-Nov-12
In youtube I found something similar (sorry I don´t remeber the tittle of the video).

Well for me was a Caos, I don´t understood nothing in the video, too much complicaded...  :-[