Install NDK in Eclipse/Android Studio
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的更多相关文章
- eclipse + Android Studio 集成 Genymotion 模拟器
Genymotion 官网 -- android 模拟器https://www.genymotion.com 虚拟机下载安装目录C:\Users\xxx\AppData\Local\Genymobil ...
- NDK(1)配置ndk,含eclipse,Android Studio1.5.1
现在的ndk配置已经非常简单,如果看到要cygwin的请关闭. 1,Eclipse 添加ndk linux,mac ,windows 相似, a.下载 ndk并解压, b.在eclipse的andro ...
- 简单的调用OpenCV库的Android NDK开发 工具Android Studio
前言 本博客写于2017/08/11, 博主非专业搞安卓开发, 只是工作的需要倒腾了下Android NDK相关的开发, 博文中有什么不正确.不严格的地方欢迎指正哈 本文后续也许还会有删改, 就 ...
- NDK开发-Android Studio+gradle-experimental开发ndk
在最新的Android Studio2.2的preview版中,增加全新的ndk支持,使用了新的gradle,以及DSL语言. 新的NDK需要使用新的Gradle插件和新的Android插件来支持! ...
- Eclipse / android studio 添加第三方jar包 步骤
eclipse 将第三方包放到libs文件夹后并没有引用. 基本步骤分为3步,具体介绍如下: 打开自己的Eclipse,在自己的Android工程上名上右键->Build Path ->C ...
- [Android] Ubuntu下Eclipse || Android Studio识别不了手机的官方解决方案
最近在转移开发平台,Android Studio一直都识别不了手机,但Eclipse却可以.经过一番调查后,发现是自己一点所以然导致的.接下来直接奉上解决教程 解决教程 在命令行终端输入lsusb命令 ...
- Android SDK Android NDK Android Studio 官方下载地址
2016.12 Android Studio Windows Includes Android SDK https://dl.google.com/dl/android/studio/install/ ...
- Android Studio NDK 学习之接受Java传入的字符串
本博客是基于Android Studio 1.3 preview版本,且默认你已经安装了Android SDK, Android NDK. 用Android Studio新建一个工程叫Prompt,其 ...
- 第四篇:Eclipse Android app 工程迁移到 Android Studio
前言:这种问题当然在所难免,所幸android studio的project 工程目录远比 Eclipse 要了然. 目录对比 我们在Eclipse中创建一个EclipseDemo的Android项目 ...
随机推荐
- Google Tango service outdated谷歌Tango的服务过时了
If you device showed "tango service outdated." It means that your Tango Core need to be up ...
- IOC容器基本原理
1 IoC容器的概念 IoC容器就是具有依赖注入功能的容器,IoC容器负责实例化.定位.配置应用程序中的对象及建立这些对象间的依赖.应用程序无需直接在代码中new相关的对象,应用程序由IoC容器进行 ...
- eclipse中不能找到dubbo.xsd报错”cvc-complex-type.2.4.c“的 两种解决方法
配置dubbo环境过程中的xml文件,安装官网的demo配置好后,出错: "Description Resource Path Location Type cvc-complex-type. ...
- centos top命令列解释
查看单个进程:top -p 进程号 PID(Process ID):进程标示号 ( 每个 process 的 ID ) USER:进程所有者的用户名 ( 该 process 所属的使用者 ) PR:进 ...
- 浏览器缓存和Service Worker
浏览器缓存和Service Worker @billshooting 2018-05-06 字数 6175 Follow me on Github 标签: BOM 1. 传统的HTTP浏览器缓存策略 ...
- KVM虚拟机windows系统增加硬盘
原文:http://www.ilanni.com/?p=6211 前一篇文章介绍了有关linux系统添加硬盘的方法,这次我们来介绍有关windows系统添加的相关步骤. 其实linux和windows ...
- Unity&C# SingerMonoManager泛型单例
管理各种管理器 ///为什么需要单例 ///单例模式核心在于对于某个单例类,在系统中同时只存在唯一一个实例,并且该实例容易被外界所访问: ///避免创建过多的对象,意味着在内存中,只存在一个实例,减少 ...
- 各位客官!鼠标点击一个Button之后究竟发生了什么?您知道么?(C#)
在谈论主题之前,让我们先简单回顾下事件的基础知识吧! 我们知道事件有发出(raises)事件的源,即event sender,也有接收事件通知(notifications)的接收者,即event re ...
- Working Set
类似于Visual Studio中的Solution 如果Eclipse中的project过多,而且不是同一个真实的项目中的,可以按Working Set对project进行组织,只是一个逻辑组织 操 ...
- C#中Cookies的读取
C#中Cookies的读取 链接: 一 .写入Cookie 1. Name 和 Value 属性由程序设定,默认值都是空引用. 2. Domain属性的默认值为当前URL的域名部分,不管发出这个c ...