參考:http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_dev_intro.html#android-dev-intro android-環境配置
中文翻譯:http://blog.csdn.net/tu_tustudio/article/details/8463119 手把手教你配置android for opencv
這篇文章主要用來協助大家學習Android開發的基本知識以及工作環境的快速搭建。 文章所寫的內容主要是在win7的系統內容下進行的,
當然,在Linux(Ubuntu) ,或者 Mac OS x 和其他的 支援android SDK的系統都可以正常運行。如果碰到有其他問題到相關的討論群組:
opencv4android:(https://groups.google.com/group/android-opencv/)和opencv-(http://answers.opencv.org/)的論壇中尋找解決問題的方法。
第一 前言
Android 是一個基於Linux ,開源的移動作業系統,由著名的搜尋引擎公司google領導組織的開放式手機聯盟(Open Handset Alliance )所開發的。
利用android進行移動開發,針對不同的平台有不同的開發環境,為了更好的理解android的開發工作,最好對下面的技術有所理解:
- Java programming language that is the primary development technology for Android OS. Also, you can find Oracle
docs on Java useful.
- Java Native Interface (JNI) that is a technology of running native code in Java virtual machine. Also, you can find Oracle
docs on JNI useful.
- Android Activity and its lifecycle, that is an essential Android API class.
- OpenCV development will certainly require some knowlege of the Android Camera specifics.
第二 android開發環境的快速設定 1. 使用TADP (NvidIA開發的)Tegra android development pack,解壓這個TADP包到某個目錄下面, 這個TADP能自動安裝相關的配置模組,直接可以進行opencv 在android下面的開發。 硬體空間:1.6G hardware, internet 下載 SDK 和NDK,unix 中間需要root許可權。
第三 人工設定android的開發環境
這時候可以根據當前機器的配置,進行合適的設定: 1. 用JAVA 開發。 (1)sun JDK6 ,JDK7 下載JDK http://www.oracle.com/technetwork/java/javase/downloads/ Ubuntu 和 Mac os下面JDK的安裝指南: http://source.android.com/source/initializing.html#installing-the-jdk 注意:openjdk 不能用於android開發。 設定 當前的java環境為SUN 的JDK sudo update-java-alternatives --set java-6-sun (2)android sdk 下載最新的android sdk,地址:http://developer.android.com/sdk/index.html,SDK的安裝配置方法:http://developer.android.com/sdk/installing.html note: 如果下載的是ADT Bundle package,這個捆綁安裝包裡麵包含了Eclipse + ADT +NDK/CDT外掛程式,Android platform-tools, 最新的android平台和最新的android 系統圖片支援。 如果你的運行系統是64位的ubuntu linux,需要安裝其他的共用庫。sudo apt-get install ia32-libs 對於紅帽的系統:sudo yun install libXtst.i386 (3) Android SDK components . android SDK tools, revision 20 or newer. . SDK Platform Android 3.0 (API 11) 最小的支援Opencv Java 調用的 API 版本為 Android 2.2 (API 8).通過查看:<uses-sdk android:minSdkVersion="8"/>標籤在AndroidMainifest.xml設定檔。
(4)Eclipse IDE
Check the Android SDK System Requirements document for a list of Eclipse versions that are compatible with the Android
SDK. For OpenCV 2.4.x we recommend Eclipse 3.7 (Indigo) or Eclipse 4.2 (Juno). They work well for OpenCV under both Windows and Linux.
If you have no Eclipse installed, you can get it from the official site.