javah location

35 views
Skip to first unread message

app.dev.s...@gmail.com

unread,
Jun 26, 2017, 6:51:42 PM6/26/17
to android-ndk
Hey dear community,

I have trouble to use havah. I installed AndroidStudio on my ubuntu machine and now I'm trying to write a native app. (The default native code works)
My problem is, that I can't call havah to create my native header files, so does anybody know where it is installed and if not how can i install it.
Thanks for any advise.

Regards,
Alex


PS: I read the post with the javah tool but it didn't help me

Alex Cohn

unread,
Jun 28, 2017, 9:14:36 AM6/28/17
to android-ndk
With Android Studio 3.0 (preview) and externalNativeBuild integration, you don't need javah. If I add a new native method to my class, e.g.

    public native void qq(int q);

then I will see it painted in red, and if I hover the mouse above, I get a red lamp. If I click it, I can choose to create the necessary C++ function:


and when I click it, I get 


extern "C"
JNIEXPORT void JNICALL
Java_com_example_egl_MainActivity_qq(JNIEnv *env, jobject instance, jint q) {

    // TODO

}

in my native-lib.cpp file.

Enjoy,
Alex Cohn

Kenneth Geisshirt

unread,
Jun 30, 2017, 10:08:06 AM6/30/17
to android-ndk
My experience with "Create function" in Android Studio is that it create the function in the wrong C++ file. I typically simply cut-n-paste it into the correct C++ file.

- kneth

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/cf6875bb-a889-44e9-affb-b822fdece01d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Kenneth Geisshirt, M.Sc., Ph.D.
Majbøl Allé 18, DK-2770 Kastrup, +45 60 62 71 82

Reply all
Reply to author
Forward
0 new messages