From 14d1777383a50b143083041517fbd29c918544bb Mon Sep 17 00:00:00 2001
From: David Friedman
Date: Tue, 26 May 2015 13:21:24 -0700
Subject: Docs: Final, master CL for NDK-docs-to-DAC for IO: "Guides,"
"Downloads" tabs.
Change-Id: Ifeeb0f55ef849cf6fd262858fae1dc0f45e7aa52
---
docs/html-ndk/ndk/guides/concepts.jd | 70 ++++++++++++++++++------------------
1 file changed, 36 insertions(+), 34 deletions(-)
(limited to 'docs/html-ndk/ndk/guides/concepts.jd')
diff --git a/docs/html-ndk/ndk/guides/concepts.jd b/docs/html-ndk/ndk/guides/concepts.jd
index bd4570e..45dceeb 100644
--- a/docs/html-ndk/ndk/guides/concepts.jd
+++ b/docs/html-ndk/ndk/guides/concepts.jd
@@ -23,7 +23,7 @@ page.title=Concepts
Already familiar with concepts inherent in native programming and in
Android development.
Working in Eclipse, and using the Android
-Development Tools ("ADT"), except where otherwise noted.
+Development Tools (ADT), except where otherwise noted.
Introduction
@@ -53,14 +53,14 @@ scripts:
Generate binaries.
Copy the binaries to your app's project path.
-For more information, see the
-ndk-build section of this guide.
+For more information, see
+ndk-build.
- Java: From your Java source, the Android build process generates {@code .dex}
-("Dalvik EXecutable") files, which are what the Android OS runs in the Dalvik Virtual Machine
+(Dalvik EXecutable) files, which are what the Android OS runs in the Dalvik Virtual Machine
(“DVM”). Even if your app contains no Java source code at all, the build process still generates a
{@code .dex} executable file within which the native component runs.
@@ -92,14 +92,14 @@ can link against other libraries.
-- Java Native Interface ("JNI"): The JNI is the interface via which the Java and C++ components
+
- Java Native Interface (JNI): The JNI is the interface via which the Java and C++ components
talk to one another. This guide assumes knowledge of the JNI; for information about it, consult the
Java Native Interface Specification.
-- Application Binary Interface ("ABI"): The ABI defines exactly how your app's machine code is
+
- Application Binary Interface (ABI): The ABI defines exactly how your app's machine code is
expected to interact with the system at runtime. The NDK builds {@code .so} files against these
definitions. Different ABIs correspond to different architectures: The NDK includes ABI support for
ARMEABI (default), MIPS, and x86. For more information, see
@@ -109,9 +109,9 @@ ARMEABI (default), MIPS, and x86. For more information, see
- Manifest: If you are writing an app with no Java component to it, you must declare the
{@link android.app.NativeActivity} class in the
-manifest. The
-Native Activity section provides more detail on how to do this, under
-“Using the native-activity.h interface.”
+manifest.
+Native Activities and Applications provides more detail on how to do this, under
+“Using the {@code native-activity.h} interface.”
@@ -119,21 +119,22 @@ ARMEABI (default), MIPS, and x86. For more information, see
the Android NDK as standalone compilers.
-- {@code Android.mk}: You must create an {@code Android.mk} configuration file inside your
-{@code jni} folder. The ndk-build script looks at this file, which defines the module and its name,
-the source files to be compiled, build flags and libraries to link. For more information, see the
-Android.mk section of this document.
+- {@code Android.mk}: You must create an
+{@code Android.mk} configuration file inside your {@code jni} folder. The ndk-build script
+looks at this file, which defines the module and its name, the source files to be compiled, build
+flags and libraries to link.
-- {@code Application.mk}: You may optionally create an Application.mk file. This file enumerates
-and describes the modules that your app requires. This information includes:
@@ -152,13 +153,14 @@ to find the Android Java framework useful for tasks including controlling the di
- Create an Android app Project in Eclipse as you would for any other Android project.
- If you are writing a native-only app, declare the {@link android.app.NativeActivity} class in
{@code AndroidManifest.xml}. You can do so from the Eclipse/ADT Android Manifest Editor, or by
-hand-editing the file. For more information, see the Native Activity section.
+hand-editing the file. For more information, see the Native Activities and
+Applications.
-- Create an Android.mk file describing the native library, including name, flags, linked libraries
-and source files to be compiled in the ‘JNI’ directory.
-- OPTIONAL: Create an {@code Application.mk} file configuring the target ABIs, toolchain,
-release/debug mode, and STL. For any of these that you do not specify, the following default values
-are used, respectively:
+
- Create an {@code Android.mk} file describing the native library, including name, flags, linked
+libraries, and source files to be compiled in the ‘JNI’ directory.
+- Optionally, you can create an {@code Application.mk} file configuring the target ABIs,
+toolchain, release/debug mode, and STL. For any of these that you do not specify, the following
+default values are used, respectively:
-
ABI: armeabi
@@ -195,7 +197,7 @@ machine, sandboxed from other applications. You can therefore still access Andro
through the JNI. In certain cases, however–such as for sensors, input events, and
assets–the NDK provides native interfaces that you can use instead of having to call
across the JNI. For more information about such support, see
-Stable APIs.
+Android NDK Native APIs.
Regardless of whether or not you are developing a native activity, we recommend that you create
your projects with the traditional Android build tools. Doing so helps ensure building and packaging
@@ -265,25 +267,25 @@ library containing the entry point to the application (such as C/C++ {@code main
function, which the app calls when the native activity starts. This function, analogous
to {@code main} in C/C++, receives a pointer to an {@code ANativeActivity} structure,
which contains function pointers to the various callback implementations that you need to write.
-Set the applicable callback function pointers in {@code ANativeActivity->;callbacks} to the
+Set the applicable callback function pointers in {@code ANativeActivity->callbacks} to the
implementations of your callbacks.
-- Set the {@code ANativeActivity->;instance} field to the address of any instance of specific
+
- Set the {@code ANativeActivity->instance} field to the address of any instance of specific
data that you want to use.
- Implement anything else that you want your activity to do upon starting.
-- Implement the rest of the callbacks that you set in {@code ANativeActivity->;callbacks}. For
-more information on when the callbacks are called, see the
-SDK documentation for Activity Lifecycles.
+
- Implement the rest of the callbacks that you set in {@code ANativeActivity->callbacks}. For
+more information on when the callbacks are called, see
+Managing the Activity
+Lifecycle.
- Develop the rest of your application.
- Create an {@code Android.mk file} in the {@code jni/} directory of your project to describe your
-native module to the build system. For more information, see the
-Android.mk section..
-
-- Once you have an {@code Android.mk} file, compile your native code using the {@code ndk-build}
-command.
+native module to the build system. For more information, see
+Android.mk.
+- Once you have an {@code Android.mk}
+file, compile your native code using the {@code ndk-build} command.
$ cd <path>/<to>/<project>
--
cgit v1.1