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. <网络攻防实践> 课程总结20169216

    课程总结20169216 每周作业链接汇总 第一周作业:Linux基础入门(1-5).基本概念及操作 第二周作业:linux基础入门(6-11).网络攻防技术概述网络攻防试验环境搭构.Kali教学视频 ...

  2. WP8.1StoreApp(WP8.1RT)---本地Toast

    WP7/8中的Toast是不能在前台弹出的. WP8.1StoreApp可以利用Win8中的方式: private void Toast(string title,string content) { ...

  3. Android中Textview显示Html,图文混排,支持图片点击放大

    本文首发于网易云社区 对于呈现Html文本来说,Android提供的Webview控件可以得到很好的效果,但使用Webview控件的弊端是效率相对比较低,对于呈现简单的html文本的话,杀鸡不必使用牛 ...

  4. 【OCP 12c】最新CUUG OCP-071考试题库(61题)

    61.(18-6) choose the best answer: View the Exhibit and examine the structure of the CUSTOMERS table. ...

  5. pymongo 学习

    查看一条记录,返回一条 dict 记录 db.Account.find_one({"UserName":"keyword"}) 查看某一列的一条记录(此时的1, ...

  6. “全栈2019”Java异常第七章:try-catch-finally组合方式

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java异 ...

  7. java -io字符流FileWrite操作演示

    FileWriter字符输出流演示: /* * FiileWriter 字符流的操作 * FileWriter 的构造方法 可传递 File类型 还可以传递String类型 * * 方法 : * wr ...

  8. 关于IPv4设置一些常见问题的解答

      问:为什么要填IP地址.网关.DNS? 如果是单部机拨号上网,是不需要填这些的.不填,或乱填,对上网都没有任何影响.但是在局域网上网(用路由器就属此环境),就一定要正确设置(手工填写或接受自动分配 ...

  9. 如何检查 IP是否冲突了

     [root@TEST_192_168_1_252 ~]# ifconfig eth0      Link encap:Ethernet  HWaddr 44:A8:42:00:1A:B5       ...

  10. 高斯分布(Gaussian Distribution)的概率密度函数(probability density function)

    高斯分布(Gaussian Distribution)的概率密度函数(probability density function) 对应于numpy中: numpy.random.normal(loc= ...