【AR】增強現實安卓編程 - Vuforia SDK 的安裝和使用 (Android Studio)

來源:互聯網
上載者:User

標籤:

Vuforia是個強大的AR平台。使用Vuforia API 可以實現物體識別,圖片追蹤,柱型追蹤,多個物件追蹤,自訂目標追蹤,雲識別,文字識別,幀標識和虛擬按鈕等功能。

它支援Android, iOS, Unity等多個環境的開發。Vuforia有免費版的,並且適合初學者上手。已經有22萬的程式員使用Vuforia進行AR編程,不過目前沒有中文版的API.

Vuforia的安裝

1.下載Vuforia SDK (~7M)

https://developer.vuforia.com/downloads/sdk 找到Android版下載

百度雲下載 http://pan.baidu.com/s/1pL2CAZx 

提取碼 ckdx

2. 解壓並放在Android sdk檔案夾的目錄下

3. 下載樣本,解壓後放到samples檔案夾內 (~26M)

https://developer.vuforia.com/downloads/sdk

百度雲下載 http://pan.baidu.com/s/1qX7KapY 

提取碼 r5cj

4.運行執行個體代碼 學習使用Vuforia SDK 核心功能 開啟Android Studio 選擇開啟Android Studio 項目匯入執行個體

5 匯入項目後 Gadle可能會構建失敗, 解決的方法如下:

      1.把build.gradle中的gradle版本改成你的Android Studio中的版本

dependencies {
classpath ‘com.android.tools.build:gradle:2.1.0‘
}

      2. 在gradle-wrapper.properties修改

      3. 把app -> build.gradle 中的 compileSdkVersion, buildToolsVersion, targetSdkVersion改成你的Android Studio中使用的版本


distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

  4. launching app 報錯 

“The currently selected variant "debug" uses split APKs, but none of the 1 split apks are compatible with the current device with density "420" and ABIs "x86".
Error while Installing APK”

        這些例子不支援“x86"的CPU, 可以建立一個模擬器,選擇”armeabi-v7a“版本的API, 但這樣有可能會非常的慢,最好用真機測試。

 

    5. "Vuforia App key is missing. Please get a valid key, by logging into your account at developer.vuforia.com and creating a new project"

     Vuforia 4.0 以上要求一個License key. 在官網上註冊一個帳號,在develop->License Manager 下按步驟填寫就能得到一個license key.

    複製粘貼到SampleApplicationSession.java 中的 InitVuforiaTask類中的Vuforia.setInitParameter(mActivity,mVuforiaFlags,"把license key 放這裡") 中的第三個參數中。 重新運行就可以了。

 

 

 

 

 

 



【AR】增強現實安卓編程 - Vuforia SDK 的安裝和使用 (Android Studio)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.