0

How to include jar files of the Android platform when using the javah tool to create a C/C++ .h header file ???

Ayesh Qumhieh
  • 1,117
  • 2
  • 11
  • 26

1 Answers1

1

Assuming:

  1. your android SDK is installed in C:\android\sdk (and you have downloaded Android 1.5 platform)
  2. your android NDK is installed in C:\android\ndk

Open command line window. Go to C:\android\ndk\samples\hello-jni folder. And execute the following:

javah -classpath C:\android\sdk\platforms\android-3;src com.example.hellojni.HelloJni

It will generate com_example_hellojni_HelloJni.h file with JNI functions for hello-jni example from Android NDK.

Mārtiņš Možeiko
  • 12,733
  • 2
  • 45
  • 45
  • Thanks Mārtiņš it worked finally, but after the semi-column I just appended the full directory to the bin folder in my project without any spaces, then the full class name as you said "com.example.hellojni.HelloJni" – Ayesh Qumhieh May 18 '12 at 14:19