开发者

How To create a Simple NDK Program in Android NDK

Hi I am new to android Programming and NDK.Yet i am not clear with working in NDK.I just downloaded android ndk r4.If i want to develop appln using NDK,and i refered

http://marakana.com/forums/开发者_开发知识库android/android_examples/49.html

for reference,But still not clear how to create the header file and implementation,I did nt have any previuos exp in c language.And they asked for run javah tool to create the JNI header file.

I dont know how to use javah tool,but i found it in java bin directory and i tried using cmd

javah -jni com.sarmal.MyLib

It shows as class file not found,

Hello Guys,when i list the folders and files,it is shown,this is the Image

What could be the problem?

What's requirement of Cygwin here?


you need to compile the java application first, using "ant compile", so the java classes will be created and javah can export the java header file


I had the same trouble earlier, but this solved it:
javah -classpath [wherever you compiled HelloWorld] -o HelloWorld.h example.jni.HelloWorld

Got it from http://www.inonit.com/cygwin/jni/helloWorld/header.html


You can navigate to the source directory of the .java file and then execute the javah -jni sourcefile.java it will create the header file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜