1、 Download NDK

https://developer.android.com/tools/sdk/ndk/index.html

  2、Install NDK

$ tar xvf android-ndk-r8e-linux-x86_64.tar.bz2 -C ~/Software/Android/
$ cd Android
$ mv android-ndk-r8e/ ndk/

  3、add PATH

$ vim ~/.bashrc
//----------------- add the following text ----------------------
export NDK_HOME=/home/linx/Software/Android/ndk
export PATH=${NDK_HOME}:$PATH
//------------------------------------------------------------------------
$ source ~/.bashrc

  4、test the ndk

$ pwd
~/Software/Android/ndk/samples/hello-gl2 $ ndk-build
Compile++ thumb : gl2jni <= gl_code.cpp
StaticLibrary : libstdc++.a
SharedLibrary : libgl2jni.so
Install : libgl2jni.so => libs/armeabi/libgl2jni.so

  the object file is "libs/armeabi/libgl2jni.so"

  the ndk install success.

  then add the ndk to IDE.

  Eclipse :

  1、download CDT

  1) offline

http://www.eclipse.org/cdt/downloads.php

  2) online

Help -> Install New Software

  add the URL

http://download.eclipse.org/tools/cdt/releases/juno/

  then the CDT install automatic.

  2、run ndk-build in the project exist

$ pwd
~/Software/Android/ndk/samples/hello-jni $ ndk-build

  3、Import the project first

File -> New -> Project.. -> Android Project from Existing Code

  browse form the project root directory.

  4、config the NDK in IDE

  1) File -> Properties

  2) builders -> New -> Program -> OK

  3)in Edit Configuration

Name : hellojni (the project you want to build)

  Table Main :

Location :
/bin/bash
Working Directory :
/bin
Arguments :
-c "cd ~/Software/Android/ndk/samples/hello-jni/ && ndk-build"

  Table Refresh :

click on "Refresh resources upon completion."

then choose the "Specific resources"

finally choose the "libs" in "Specific resources" and Finish it 

  Table Build Options :

click on everything in "Run in builder"

then choose the "Specify Resources"

finally choose the "jni"  in "Specify Resources"

  Finish.

  Android Studio :

  ok, there is a FAQ answered this question:

Is it planned to support NDK development in Android Studio or IntelliJ IDEA?

We have recently announced that we’re starting work on an IDE for C++, and we plan to eventually support NDK development as part of that effort. As for NDK development support in Android Studio, Google hasn’t announced anything so far.

  so just run ndk-build in terminal.

Install NDK in Eclipse/Android Studio的更多相关文章

  1. eclipse + Android Studio 集成 Genymotion 模拟器

    Genymotion 官网 -- android 模拟器https://www.genymotion.com 虚拟机下载安装目录C:\Users\xxx\AppData\Local\Genymobil ...

  2. NDK(1)配置ndk,含eclipse,Android Studio1.5.1

    现在的ndk配置已经非常简单,如果看到要cygwin的请关闭. 1,Eclipse 添加ndk linux,mac ,windows 相似, a.下载 ndk并解压, b.在eclipse的andro ...

  3. 简单的调用OpenCV库的Android NDK开发 工具Android Studio

    前言 本博客写于2017/08/11, 博主非专业搞安卓开发, 只是工作的需要倒腾了下Android NDK相关的开发, 博文中有什么不正确.不严格的地方欢迎指正哈    本文后续也许还会有删改, 就 ...

  4. NDK开发-Android Studio+gradle-experimental开发ndk

    在最新的Android Studio2.2的preview版中,增加全新的ndk支持,使用了新的gradle,以及DSL语言. 新的NDK需要使用新的Gradle插件和新的Android插件来支持! ...

  5. Eclipse / android studio 添加第三方jar包 步骤

    eclipse 将第三方包放到libs文件夹后并没有引用. 基本步骤分为3步,具体介绍如下: 打开自己的Eclipse,在自己的Android工程上名上右键->Build Path ->C ...

  6. [Android] Ubuntu下Eclipse || Android Studio识别不了手机的官方解决方案

    最近在转移开发平台,Android Studio一直都识别不了手机,但Eclipse却可以.经过一番调查后,发现是自己一点所以然导致的.接下来直接奉上解决教程 解决教程 在命令行终端输入lsusb命令 ...

  7. Android SDK Android NDK Android Studio 官方下载地址

    2016.12 Android Studio Windows Includes Android SDK https://dl.google.com/dl/android/studio/install/ ...

  8. Android Studio NDK 学习之接受Java传入的字符串

    本博客是基于Android Studio 1.3 preview版本,且默认你已经安装了Android SDK, Android NDK. 用Android Studio新建一个工程叫Prompt,其 ...

  9. 第四篇:Eclipse Android app 工程迁移到 Android Studio

    前言:这种问题当然在所难免,所幸android studio的project 工程目录远比 Eclipse 要了然. 目录对比 我们在Eclipse中创建一个EclipseDemo的Android项目 ...

随机推荐

  1. 搭建简易Web GIS网站:使用GeoServer+PostgreSQL+PostGIS+OpenLayers3

    Web GIS系列: 搭建简易Web GIS网站:使用GeoServer+PostgreSQL+PostGIS+OpenLayers3 使用GeoServer+QGIS发布WMTS服务 使用GeoSe ...

  2. MYSQL - JSON串中查找key对应的值

    1.建表 -- 建表 drop table if exists ta_product2; CREATE TABLE ta_product2( id int primary key auto_incre ...

  3. Android通过xml生成创建View的过程解析

    Android的布局方式有两种,一种是通过xml布局,一种是通过java代码布局,两种布局方式各有各的好处,当然也可以相互混合使用.很多人都习惯用xml布局,那xml布局是如何转换成view的呢?本文 ...

  4. 動態修改 XML 欄位

    /* -- for test DECLARE @content VARCHAR(50) DECLARE @folioId VARCHAR(50) DECLARE @opinionType VARCHA ...

  5. SqlServer获取字符串中数字,中文及字符部分数据

    --获取英文字符数据 Create function [dbo].[Fun_GetChar] ( ) ) ) AS BEGIN BEGIN ,'') --删掉一个非数字的字符,循环结束,剩余的为数字部 ...

  6. Python入门基础学习 三

    Python入门基础学习 三 数据类型 Python区分整型和浮点型依靠的是小数点,有小数点就是浮点型. e记法:e就是10的意思,是一种科学的计数法,15000=1.5e4 布尔类型是一种特殊的整形 ...

  7. 个人介绍&我的GitHub注册经历&初步使用

    (1)个人介绍 我叫刘雨恬,目前是南通大学计科院网络工程141班的一名大二的学生,学号1413042004.由于学习软件工程的需要,我注册了cnblogs的这个博客账号,方便以后的学习交流.在兴趣爱好 ...

  8. HttpServletRequest介绍

    HttpServletRequest对象代表客户端的请求,当客户端通过HTTP协议访问服务器时,HTTP请求头中的所有信息都封装在这个对象中,通过这个对象提供的方法,可以获得客户端请求的所有信息. 二 ...

  9. 介绍 ASP.NET Identity - ASP.NET 应用程序的成员身份认证系统

    ASP.NET Identity 是构建 ASP.NET web 应用程序的一种新的身份认证系统.ASP.NET Identity 可以让您的应用程序拥有登录功能,并可以轻松地自定义登录用户的相关数据 ...

  10. jenkins修改时区

    查看jenkins目前的时区 访问http://your-jenkins/systemInfo,查看user.timezone变量的值 默认是纽约时间 修改时区 查https://wiki.jenki ...