NDK API参考文档? [英] NDK API reference docs?

查看:243
本文介绍了NDK API参考文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找的NDK图书馆参考文献,谁知道在哪里可以找到他们呢?不是Java的API。我找不到任何在NDK目录或网上。

I'm looking for reference documentation for the NDK libraries, anyone know where to find them? not java APIs. I can't find any in the NDK directory or online.

推荐答案

是的NDK的API文档是很稀疏。大多数docmentation是在NDK本身的文档文件夹中。还实施例是有益的。

Yes the API documentation of the NDK is very sparse. Most of the docmentation is in the docs folder of the NDK itself. Also the examples are helpful.

试着读通过标准的JNI文档。 (http://java.sun.com/docs/books/jni/)而Android NDK基本上只是JNI。但在Android NDK,如果你相应的命名你的函数不需要特殊的头神奇。

Try to read through the "standard" JNI documentation. (http://java.sun.com/docs/books/jni/) The Android NDK is basically just JNI. But the Android ndk does not need the special header magic if you name your function accordingly.

例如:

Java类:

 package com.example.foo;

 class Bar {
     native void jnistuff();
 }

在您调用jnistuff的NDK将寻找方法:

where you call jnistuff the NDK will look for the method:

void Java_com_example_foo_Bar_jnistuff(JNIEnv* env, jobject *self)
{
  [...]
}

和自动调用它。不要忘了外部C,如果你使用C ++

and automatically call it. Do not forget "extern C" if you use C++

这篇关于NDK API参考文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆