jianglk.darker
7ee447c011
|
4 months ago | |
---|---|---|
.. | ||
header_only_include/nativehelper | 4 months ago | |
include | 4 months ago | |
include_jni | 4 months ago | |
include_platform/nativehelper | 4 months ago | |
include_platform_header_only/nativehelper | 4 months ago | |
tests | 4 months ago | |
tests_mts | 4 months ago | |
ALog-priv.h | 4 months ago | |
Android.bp | 4 months ago | |
DlHelp.c | 4 months ago | |
DlHelp.h | 4 months ago | |
ExpandableString.c | 4 months ago | |
ExpandableString.h | 4 months ago | |
JNIHelp.c | 4 months ago | |
JNIPlatformHelp.c | 4 months ago | |
JniConstants.c | 4 months ago | |
JniConstants.h | 4 months ago | |
JniInvocation-priv.h | 4 months ago | |
JniInvocation.c | 4 months ago | |
NOTICE | 4 months ago | |
OWNERS | 4 months ago | |
PREUPLOAD.cfg | 4 months ago | |
README.md | 4 months ago | |
TEST_MAPPING | 4 months ago | |
file_descriptor_jni.c | 4 months ago | |
libnativehelper.map.txt | 4 months ago | |
libnativehelper_lazy.c | 4 months ago | |
libnativehelper_lazy.h | 4 months ago |
README.md
libnativehelper
libnativehelper is a collection of JNI related utilities used in Android.
There are several header and binary libraries here and not all of the functionality fits together well. The header libraries are mostly C++ based. The binary libraries are entirely written in C with no C++ dependencies. This is by design as the code here can be distributed in multiple ways, including mainline modules, so keeping the size down benefits everyone with smaller downloads and a stable ABI.
Header Libraries
jni_headers
This is a header library that contains provides the API represented in
the JNI Specification 1.6. Any project in Android that depends on
jni.h
should depend on this.
See:
libnativehelper_header_only
These headers provide utilities that defined entirely within the
headers. There are scoped resource classes that make common JNI
patterns of acquiring and releasing resources safer to use than the
JNI specification equivalents. Examples being ScopedLocalRef
to
manage the lifetime of local references and ScopedUtfChars
to manage
the lifetime of Java strings in native code and provide access to utf8
characters.
See:
- nativehelper/nativehelper_utils.h
- nativehelper/scoped_utf_chars.h
- nativehelper/scoped_bytes.h
- nativehelper/scoped_string_chars.h
- nativehelper/scoped_primitive_array.h
- nativehelper/scoped_local_ref.h
- nativehelper/scoped_local_frame.h
jni_platform_headers
The jni_macros.h
header provide compile time checking of JNI methods
implemented in C++. They ensure the C++ method declaration match the
Java signature they are associated with.
See:
Libraries
libnativehelper
A shared library distributed in the ART module that provides helper routines built on Java APIs. This library depends on details that are private to libcore and use should be restricted to platform code and within the ART module.
This library also contains the JNI invocation API from the JNI Specification and the glue that connects the ART runtime to the API implementation. The glue logic is platform only as it is used with the Zygote and the standalone dalvikvm.
See:
- nativehelper/JNIHelp.h
- nativehelper/JniInvocation.h
- nativehelper/JNIPlatformHelp.h
- nativehelper/ScopedBytes.h
- nativehelper/ScopedUtfChars.h
- nativehelper/ScopedLocalFrame.h
- nativehelper/ScopedLocalRef.h
- nativehelper/ScopedPrimitiveArray.h
- nativehelper/ScopedStringChars.h
- nativehelper/toStringArray.h
libnativehelper_compat_libc++
This shared and static library contains a subset of the helper routines in libnativehelper based on public Java API. This code can be statically linked as the Java APIs it depends on are considered stable. The name of this library is a misnomer since it contains no C++ code.
See: