Reputation:
does anyone know how to import this ( https://github.com/steveno/balistica ) lib into Android Studio ? How I understand it is written on Vala language and I have never worked with it. Any kind of help will be appreciated.
Upvotes: 2
Views: 68
Reputation:
It is quite hard to achieve, since Vala code can't be compiled for Android easily. But if you are adventurous, you can try to follow what is said in this article, event if it is a bit old, and I'm not sure it will be still working.
Once you cross-compiled the library, just add the .so
file in your project and try something like that:
public class MyActivity extends Activity {
// This will load libmylibrary.so
static { System.loadLibrary("mylibrary"); }
// "Import" the foo method from the library
private static native void foo ();
}
Vala automatically changes the names to camel case and the methods signatures to make it work in C, so you'll probably have to read the .h
file to know how to call each method.
Upvotes: 1