Lines Matching refs:native
21 <p>This guide assumes that you are already familiar with concepts inherent in native programming an…
28 tools allowing you to embed C or C++ (“native code”) into your Android apps. The ability to use
29 native code in Android apps can be particularly useful to developers who wish to do one or more of
40 <p>This section introduces the main components used in building a native application for Android,
62 {@code .dex} executable file within which the native component runs.
64 <p>When developing Java components, use the {@code native} keyword to indicate methods implemented
65 as native code. For example, the following function declaration tells the compiler that the
66 implementation is in a native library:</p>
71 public native int add(int x, int y);
77 <li>Native shared libraries: The NDK builds these libraries, or {@code .so} files, from your native
143 <p>The general flow for developing a native app for Android is as follows:</p>
146 native code.
152 <li>If you are writing a native-only app, declare the {@link android.app.NativeActivity} class in
156 <li>Create an {@code Android.mk} file describing the native library, including name, flags, linked
175 <li>Place your native source under the project's {@code jni} directory.</li>
176 <li>Use ndk-build to compile the native ({@code .so}, {@code .a}) libraries.</li>
186 write a completely native activity. {@link android.app.NativeActivity} handles the communication
187 between the Android framework and your native code, so you do not have to subclass it or call its
188 methods. All you need to do is declare your application to be native in your
189 {@code AndroidManifest.xml} file, and begin creating your native application.</p>
194 assets–the NDK provides native interfaces that you can use instead of having to call
198 <p>Regardless of whether or not you are developing a native activity, we recommend that you create
202 <p>The Android NDK provides you with two choices to implement your native activity:</p>
206 header defines the native version of the
208 that you need to create your native activity. Because the main thread of your application handles
221 <p>For more information on how to use this static library, examine the native-activity sample
226 <p>To implement a native activity with the
232 your native code.</li>
233 <li>Declare your native activity in the {@code AndroidManifest.xml} file.</li>
256 android:value="native-activity" />
266 <li>Create a file for your native activity, and implement the function named in the
269 The app calls this function when the native activity starts. This function, analogous
287 native module to the build system. For more information, see
290 file, compile your native code using the {@code ndk-build} command.</li>
297 <li>Build and install your Android project as usual. If your native code is in