Android JNI.

Previous topic - Next topic

Hatonastick

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.  ;/
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

trucidare

yes and nope - you have to put your c++ code special one into the project structure to get the ant to build it.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Hatonastick

#2
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.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Kitty Hello

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.

Hatonastick

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.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

mentalthink

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...  :-[