十一月 12, 2015

Eclipse 创建、生成NDK步骤总结

Written by

本说明基于Eclipse+ADT+CDT开发,Eclipse版本号:Mars.1 Release 4.5.1、ADT版本:23.0.7.2120684、CDT版本:8.8.0.201509131935。

注:部分内容来自网络,这里只是做个资料收集整理,为自己和其他读者提供便利。

1、搭建NDK开发环境

Eclipse和Android SDK的安装就不说了,注意顺序,尤其是CDT和ADT的安装顺序

(1)下载NDK包,并解压http://developer.android.com/tools/sdk/ndk/index.html

(2)下载CDT(C/C++开发环境插件),在Eclipse中安装此插件。

(3)下载ADT,在Ecplise中安装此插件,一定要选中NDK Plugin

(4)在Ecplise中配置Android SDK和NDK SDK的路径,在Eclipse的Window->Preferences->Android中设置,我本机的设置为Android SDK Location为“C:\Android\android-sdk”,NDK Location为“C:\Android\android-ndk-r8e”。

2、创建NDK项目

(1)首先在Eclipse中创建一个Android工程

(2)在Package Explorer中选中刚才创建的Android工程,右键选择Android Tools -> Add Native Support..,填写需要生成的动态库的名称,比如“HelloWorld”,此时工程中多了一个叫做“jni”的目录,并自动生成了一个C++文件和一个Androd.MK文件,所有的C++源代码就放在这个目录中。这样,就跟Eclipse工程添加了C/C++属性,就能够用CDT插件在Eclipse中进行C/C++开发了。

(3)在Java代码中声明本地方法并调用
    网上资料很多
(4)在C/C++代码中实现本地方法
    网上资料很多

Category : C/C++JavaNDK

Tags :

Comments

8 Responses

  1. Starr说道:

    Your answer lifts the inectligenle of the debate.

  2. Le Coran a bon dos pour nous faire avaler les couleuvres d’un soit-disant islam modéré. C’est ignorer les fatwas qui sont bcp plus virulentes, et qui, elles, illustrent le vrai visage de l’islam.Personne ne pourra dire qu’il ne savait pas…

  3. Just cause it’s simple doesn’t mean it’s not super helpful.

  4. http://www./说道:

    It’s posts like this that make surfing so much pleasure

  5. Eu não vi nenhum dos dois programas que falas, mas não me custa nada imaginar como foi porque já vi alguns no tempo em que ainda tinha paciência. Fica-me, por isso, uma dúvida: O “representante dos professores” não sendo da FENPROF, representava que professores? Era de um sindicato não afecto à FENPROF ou representava os professores que moram no prédio dele?

  6. Lu Er Fu:10 Minuten Dauerhupen? Dann hat er statistisch nochmal ca.10 Minuten und dann sollte das Ding aus Gründen der Dauerfestigkeit eigentlich den Geist aufgeben. Wenn hier in D irgendein Sportgroßereignis ist werden bei meinem Kumpel vorab die Bestände an Signalhörnern aufgestockt. Egal wer gewinnt, der dauerhupendehupende Autokorso sorgt für Umsatz. So oder so.PS: die Zahnräder des Rückwärtsgangs waren bei den Schaltgetrieben auf 30 Min. Lebensdauer ausgelegt.

  7. I’m glad to hear your making progress, no matter what the pace. Our heavenly Father works in time frames that sometime seem to take forever in working in our lives but he always has the perfect out come.I saw a great father – son relationship with you and Luke when you were here at Christmas.You go Daddy!-Steve BWednesday, February 4, 2009 – 02:43 PM

  8. magnificent points altogether, you simply received a emblem new reader.

    What may you recommend about your put up that
    you made a few days ago? Any certain?

发表评论

电子邮件地址不会被公开。

Proudly powered by WordPress and Sweet Tech Theme