NDK API reference docs? [closed]

牧云@^-^@ 提交于 2019-12-30 03:56:05

问题


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.


回答1:


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.

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.

for example:

a java class:

 package com.example.foo;

 class Bar {
     native void jnistuff();
 }

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

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

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




回答2:


The best documentation for NDK libraries is the folder with corresponding headers $NDK/platforms/android-n/arch-arm/usr/include. Do not overlook it.

As others have noted, $NDK/docs and http://developer.android.com/sdk/ndk/overview.html are also essential.




回答3:


I have been exploring the NDK and trying to learn about it and I found the following page to be helpful. It may not be exactly what the original question was asking for, but it may be a helpful resource nonetheless.

http://mobilepearls.com/labs/native-android-api/




回答4:


Have you seen the file called STABLE_APIS.html in the NDK docs directory? That should give you a good start. Most Linux features (for example pthreads, C library) are available. The newest NDK also includes STL and other features.




回答5:


NDK is just a build tool for android to build APP with JNI. If you have questions about JNI API, there are JNI document in its official page.




回答6:


if i'm not mistaken there is not refference API as the JDK has, you got some documentation and explanation in the docs directory in the NDK itself, it's one of the greatest drawbacks of the NDK if you ask me...

:-(




回答7:


I fear, the only way to get a complete reference of all JNI interface funktions is to study the original android C source code inside the folder /AndroidFrameworksBase/...whatsoever.../jni (subfolders).

By studying this, you will actually know how to call all the published interface functions for usage with the NDK.

The NDK is merely a wrapper, a skeleton and has no Android API documentation for C/C++ at all. However, it isn't easy to find those files for all the available Android versions online.



来源:https://stackoverflow.com/questions/4638778/ndk-api-reference-docs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!