.
In some of the complexities of computing, C + + is more efficient in scenarios where high performance is required, and code is easier to reuse.
Of course there are other advantages that drive us to choose a relatively efficient and secure NDK to develop our applications.OK, so many ndk, so how do you use the NDK to develop applications?As the saying go
called Java Native Interface (Java Local call). Starting with Java1.1, JNI becomes part of the Java platform, which allows Java code to interact with code written in other languages, such as cc++. The concept of JNI was not introduced from Android.In short, the Android NDK offers a number of cross-compilation toolchain and Android-brought libraries that allow developers to invoke programs in their native languages. The cross-compilation toolchain pro
to compile", "compilation characteristics Requirements", etc.), you can create a so.The NDK can automatically package so with Java applications, greatly reducing the developer's packaging effort.Second, NDK Construction of bad environment:Note: At present has been out of ndk-r9b, because the author wrote this log when the do
environment, compile it into Linux-specific platform files. So or. A. The good news is that the NDK version provides support for the development Kit under Windows, Cygwin can not be used, directly under Windows to compile the platform is also feasible, but in order to show learning, it is best to understand a little.II. NDK Environment Building 1, installing CDT If you are using an integrated ADT IDE that
introduce it more here)
2. NDK installation package (official website provides download http://developer.android.com/tools/sdk/ndk/index.html) but after decompression path, it is strongly recommended that not contain spaces. For example: C: \ Program Files \ android-ndk-r9b \, This is not recommended. Why is space no
NDK interacts with C/C ++ through Java's Jni. If it doesn't work with Jni, you can check out what I 've previously compiled. I. Build an NDK Development Environment1. Download the right NDK version of the platform. Download URL:Http://developer.android.com/tools/sdk/
Type ' * * * * * ' could not being resolvedMethod ' ****** ' could not being resolved et cetera a lot of that sort of mistakeWorkaround:This is due to the fact that the jni.h is not imported, and this file is under the NDK directory.So, refer to the following steps:Project Properties, C + + general, Path and Symbols Select the include tag, ADD, $Android _ndk_home/platforms/android-* */arch-arm/usr/include and select all languages. Finally, apply---OK,
By referring to the information on the network, record the process, experience, and problems of building the android ndk R7 Development Environment on Ubuntu. Hope to help you.
1. Download the package android-ndk-r7-linux-x86.tar.bz2 (you can copy it to the path you want to store, for example, my path is/home/XXX/android_install)2. Enter the package storage direc
+ + language4. Use the cross-compilation tool to compile the C + + native code and finally link to the *.so executable5, the actual implementation of Java code to communicate with the local C + + codeNDK installation process:Under the premise that the computer has already configured the Android environment, only need to download the NDK (R7 above version), this is a compressed package, decompression is ava
NDK directory StructureAfter the NDK is downloaded, the directory structure is as follows:
Directory Name
Describe
Build
to store and compile the associated script file, the outermost ndk-build is to call the makefile file in that directory, where makefile files are stored in the Build/core directory
Docs
Obtain the domain and method descriptor of NDK development, and develop ndk
In the two blogs: calling methods for NDK development and accessing domains for NDK development, we need a parameter called descriptor when obtaining the domain ID and method ID, in actual development, how do we know the descriptor of the dom
Start to learn about NDK development. First, start with the output of the Hello World instance.
NDK development steps:
1. Declare the native method in the Java File
Public class TestActivity extends Activity {static {System. loadLibrary ("my-ndk");} // declare the native method of the jni layer and use the native keyword public native String stringFromJNI (); @
NDK compiles C + +. Prompt for no header files (ndk-build error:string:No such file or directory)It's a sad question. Wondering why a string can not find it. So Baidu arrived.。。If you encounter this problem, just in the folder application.mk file where you are located. Join:App_stl: = gnustl_staticwill be able to find the standard library!The last to know the truth of me. Tears Fall down! 10.29 Work Note
In front of the words: This article is a look at how to gracefully use the NDK after the original blog features complement. In order to facilitate everyone's reading order, directly added to the original blog, if there is copyright infringement, please contact me. This blog has been reproduced, there is original, only in the original blog has been modified, so classified to original, if not, please leave a message.This blog reprint address is as follo
From: http://blog.csdn.net/android_panda/article/details/7607946
1. Build an android Development EnvironmentSetting up the android development environment is not a key point. I believe many people who have read this article have successfully set up the environment. Let's give a brief description here. Download JDK download eclipse download Android SDK start eclip
great for developers.
The NDK integrates the cross compiler and provides the corresponding MK file isolation CPU, platform, ABI and other differences, developers simply need to modify the Mk file (stating "which files need to compile", "compilation characteristics Requirements", etc.), you can create a so.
The NDK can automatically package so with Java applications, greatly reducing the developer's
Install cygwin on Windows
Set windows path:
Set Windows user variable ndk:
EditCodeTest-libstl.cpp# Include
Run cygwin$ CD $ ndk $ CD samples/test-libstdc ++ $ ndk-build
Create AVD: avd2.3.3
Run emulatorEmulator-AVD avd2.3.3-partition-size 128-no-boot-anim
Push File$ ADB remount $ ADB push libs/armeabi/test-libstl/system/bin
Run the progr
(Liblog). Second, the implementation of the NDK instance:for the development of the NDK under the Windows environment, if the NDK used was a prior version of R7, it was necessary to install Cygwin in order to use the NDK, so the builder needed to be configured for Eclipse was actually performing Cygwin, The
, the Android platform's third-party applications were developed by relying on Java-based Dalvik specially crafted virtual machines. The release of the native SDK gives developers more direct access to Android system resources and uses the traditional C or C + + language to code and embed native library files directly into the program envelope file (. apks). First, tool preparation1.eclipse ADT (Here are just a few more)2.NDK installation package (
Android NDK project compilation and link debugging
Prerequisites: JDK 6.0, android SDK, NDK r9, and javassele4.2 development environments have been installed.
It is recommended to download Android integrated KIT development adt-bundle-windows-x86, and then download Android NDK
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.