<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>QCAR &#8211; 記下來</title>
	<atom:link href="https://noter.tw/tag/qcar/feed/" rel="self" type="application/rss+xml" />
	<link>https://noter.tw</link>
	<description>一路上踩到的坑、遇到的問題，一點一滴記下來，希望能幫助到需要的人~</description>
	<lastBuildDate>Mon, 13 Mar 2023 14:32:02 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>

<image>
	<url>https://noter.tw/wp-content/uploads/cropped-old-1130742_1920-1-32x32.jpg</url>
	<title>QCAR &#8211; 記下來</title>
	<link>https://noter.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Qualcomm Vuforia 教學 (4) – 使用 Android NDK 版本並開啟多重偵測</title>
		<link>https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/</link>
					<comments>https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/#comments</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Tue, 09 Dec 2014 09:10:57 +0000</pubDate>
				<category><![CDATA[手機 App]]></category>
		<category><![CDATA[Qualcomm]]></category>
		<category><![CDATA[Vuforia]]></category>
		<category><![CDATA[ImageTarget]]></category>
		<category><![CDATA[java.lang.UnsatisfiedLinkError]]></category>
		<category><![CDATA[JNI]]></category>
		<category><![CDATA[multi]]></category>
		<category><![CDATA[The code of method xxx is exceeding the 65535 bytes limit]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AR]]></category>
		<category><![CDATA[NDK]]></category>
		<category><![CDATA[QCAR]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=3371</guid>

					<description><![CDATA[<p>接續前幾篇教學，我們已經建置好 Vuforia 開發及執行環境、建立屬於自己的 Image Target、以及把茶壺更換成方塊&#160;，這邊繼續記錄怎麼使用 Android NDK 來開發，內文有&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (4) – 使用 Android NDK 版本並開啟多重偵測</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>接續前幾篇教學，我們已經<strong>建置好 Vuforia 開發及執行環境</strong>、<strong>建立屬於自己的 Image Target</strong>、以及<strong>把茶壺更換成方塊</strong>&nbsp;，這邊繼續記錄怎麼使用 Android NDK 來開發，內文有說明為什麼好好的 Android 版本不用卻要用到麻煩的 Android NDK 開發。 </p>



<span id="more-3371"></span>



<p><strong>2016-07-07 更新：本篇為 3.x 版本，目前 Vuforia 以更新到 5.5.9，新版本使用方式請參考&nbsp;</strong></p>



<p><strong>Android Vuforia 系列：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/3639/android-vuforia-with-jpct-ae-1-%e5%9f%ba%e6%9c%ac%e7%af%84%e4%be%8b/" data-wpel-link="internal">Android Vuforia with jPCT-AE (1) – 基本範例</a></li><li><a href="https://noter.tw/3688/android-vuforia-with-jpct-ae-2-%e8%bc%89%e5%85%a5-obj-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (2) – 載入 obj 測試</a></li><li><a href="https://noter.tw/3735/android-vuforia-with-jpct-ae-3-%e8%bc%89%e5%85%a5-md2-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (3) – 載入 md2 測試</a></li><li><a href="https://noter.tw/3737/android-vuforia-with-jpct-ae-4-%e8%bc%89%e5%85%a5-3ds-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (4) – 載入 3DS 測試</a></li><li><a href="https://noter.tw/3739/android-vuforia-with-jpct-ae-5-%e5%a4%9a%e9%87%8d%e6%a8%a1%e5%9e%8b%e8%bc%89%e5%85%a5%ef%bc%8c%e4%bb%a5-obj-%e7%82%ba%e4%be%8b/" data-wpel-link="internal">Android Vuforia with jPCT-AE (5) – 多重模型載入，以 obj 為例</a></li></ul>



<p>馬上解除大家疑問，使用 Android NDK 開發絕對不是自找麻煩，而是小蛙搜遍的各式各樣的教學後得到的答案。</p>



<ul class="my-li bg-darkblue wp-block-list"><li>如果你的 APP 希望可以在一個畫面偵測到 1 個以上 Image Target 的話，Android 版本無法做到這項需求</li><li>如果你的 3D 模型不是只有正方形、長方形這樣簡單</li></ul>



<p>在 Android 版本無法解決上述兩個問題，因此才需要使用 Android NDK 的方式來開發。Android 版本中如果 3D 模型太複雜，在定義像&nbsp;Teapot.java 這種檔案的時候會出現「<strong>The code of method xxx is exceeding the 65535 bytes limit</strong>」錯誤，使用網路上的一些免費模型來測試都沒辦法。</p>



<p>Android NDK 的安裝方式在&nbsp;<a href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) – 安裝 Vuforia</a> 有提到 (只是下載以及設定 Eclipse Android NDK 目錄)，如果安裝 NDK 有遇到什麼問題，請自行 Google &#8230;</p>



<p>先說明 Android NDK 的使用方法，也許有更好的方法，但小蛙找到這種可用的方法就直接用囉！</p>



<p>1. 到 <a href="https://developer.vuforia.com//resources/sample-apps/image-targets-c?t=android-4820236" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">參1<span class="wpel-icon wpel-image wpel-icon-6"></span></a> 下載 NDK 版本的範例 &#8211; <a href="https://developer.vuforia.com//resources/sample-apps/image-targets-c?t=android-4820236#sampleAppModal" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external" class="wpel-icon-right">ImageTargetsNative-3-0-5.zip<span class="wpel-icon wpel-image wpel-icon-6"></span></a></p>



<p>2. 解壓縮檔案，並且依照  <a href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/" target="_blank" rel="noreferrer noopener" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) – 安裝 Vuforia</a> 提到的方法將專案匯入到 Eclipse，要這邊要注意路徑的問題，如果你的工作目錄有空白一定要避開，像小蛙本來在 Program Files 下，但執行 NDK 時會發生錯誤，因此改成放在 D:\vuforia-sdk-android-3-0-9\samples\ 下。</p>



<p>3. 先執行一次專案看看，發現點了 Start 就出現「<strong>java.lang.UnsatisfiedLinkError: Native method not found: com.qualcomm.QCARSamples.ImageTargets.ImageTargets.setActivityPortraitMode:(Z)V</strong>」錯誤 &#8230;</p>



<p>4. 我們先執行 NDK 編譯出新的 .so 檔案才能繼續使用，開啟「cmd」->以小蛙為例，進到「D:\vuforia-sdk-android-3-0-9\samples\ImageTargetsNative\jni>」，注意 Android.mk 檔案中已經設定了路徑，所以一定要放在 sample 目錄下，或如果對 NDK 熟悉的網友可直接修改</p>



<pre class="wp-block-preformatted withcode">Android.mk D:\vuforia-sdk-android-3-0-9\samples\ImageTargetsNative\jni> ndk-build 
[armeabi-v7a] Compile++ arm  : ImageTargetsNative &lt;= ImageTargets.cpp …  
[armeabi-v7a] Install        : libVuforia.so => libs/armeabi-v7a/libVuforia.so</pre>



<p>5. 整個過程如果沒有出現 Error 就表示編譯成功，回到 Eclipse 的 ImageTargetsNative 專案，重新整理專案後執行</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><a href="http://lh3.ggpht.com/-_WHT-WL9d7s/VIa3nGyAHiI/AAAAAAAAKlQ/np528SHrnpw/s0/016.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img fetchpriority="high" decoding="async" src="//lh3.ggpht.com/-_WHT-WL9d7s/VIa3nGyAHiI/AAAAAAAAKlQ/np528SHrnpw/w500-o/016.png" alt="016.png" width="250" height="445" title="016.png"/></a></figure></div>



<p>6. 開啟被封印的能力，多重偵測！開啟 ImageTargetsNative > jni > ImageTargets.cpp，找到</p>



<pre class="wp-block-preformatted withcode">JNIEXPORT void JNICALL Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_onQCARInitializedNative(JNIEnv *, jobject)
 {
     …
 }</pre>



<p>把上述「…」部分改成以下內容</p>



<pre class="wp-block-preformatted withcode">// Comment in to enable tracking of up to 2 targets simultaneously and
 // split the work over multiple frames:
 QCAR::setHint(QCAR::HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS, 2);
 // Register the update callback where we handle the data set swap:
 QCAR::registerCallback(&amp;updateCallback);</pre>



<p>7. 重複執行第 4 步驟，與第 5 步驟，多重偵測功能正式被開啟！</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><a href="http://lh5.ggpht.com/-ImbnYucZT3E/VIa7qUiRHEI/AAAAAAAAKlk/DpfAdo3ESvQ/s0/017.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" src="//lh5.ggpht.com/-ImbnYucZT3E/VIa7qUiRHEI/AAAAAAAAKlk/DpfAdo3ESvQ/w500-o/017.png" alt="017.png" width="250" height="445" title="017.png"/></a></figure></div>



<p><strong>Qualcomm Vuforia&nbsp;</strong><strong>系列：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1/" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) – 安裝 Vuforia</a></li><li><a href="https://noter.tw/3347/qualcomm-vuforia-%e6%95%99%e5%ad%b8-2-create-image-target/" data-wpel-link="internal">Qualcomm Vuforia 教學 (2) – Create Image Target</a></li><li><a href="https://noter.tw/3360/qualcomm-vuforia-%e6%95%99%e5%ad%b8-3-%e6%9b%bf%e6%8f%9b%e8%8c%b6%e5%a3%ba-android-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (3) – 替換茶壺 – Android 版本</a></li><li><a href="https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (4) – 使用 Android NDK 版本並開啟多重偵測</a></li><li><a href="https://noter.tw/3392/qualcomm-vuforia-%e6%95%99%e5%ad%b8-5-%e6%9b%bf%e6%8f%9b%e8%8c%b6%e5%a3%ba-android-jni-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (5) – 替換茶壺 – Android JNI 版本</a></li><li><a href="https://noter.tw/3403/qualcomm-vuforia-%e6%95%99%e5%ad%b8-6-3d-model-obj-h/" data-wpel-link="internal">Qualcomm Vuforia 教學 (6) – 3D model -&gt; .obj -&gt; .h</a></li></ul>



<h2 class="para wp-block-heading">參考資料</h2>



<ul class="my-li bg-darkblue wp-block-list"><li><a rel="noreferrer noopener nofollow external" aria-label="Image Targets - C++ @ Vuforia Developer Portal (在新分頁中開啟)" href="https://developer.vuforia.com/resources/sample-apps/image-targets-c" target="_blank" data-wpel-link="external" class="wpel-icon-right">Image Targets &#8211; C++ @ Vuforia Developer Portal<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li><li><a href="https://developer.vuforia.com/resources/dev-guide/detecting-and-tracking-multiple-targets-simultaneously" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external" class="wpel-icon-right">Detecting and Tracking Multiple Targets Simultaneously&nbsp;@ Vuforia Developer Portal<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (4) – 使用 Android NDK 版本並開啟多重偵測</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Qualcomm Vuforia 教學 (1) &#8211; 安裝 Vuforia</title>
		<link>https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/</link>
					<comments>https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/#comments</comments>
		
		<dc:creator><![CDATA[黃小蛙]]></dc:creator>
		<pubDate>Mon, 08 Dec 2014 10:08:50 +0000</pubDate>
				<category><![CDATA[手機 App]]></category>
		<category><![CDATA[NDK]]></category>
		<category><![CDATA[QCAR]]></category>
		<category><![CDATA[Qualcomm]]></category>
		<category><![CDATA[Vuforia]]></category>
		<category><![CDATA[vuforia-sdk-android]]></category>
		<category><![CDATA[VuforiaSample]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AR]]></category>
		<guid isPermaLink="false">http://wazai.net/?p=3320</guid>

					<description><![CDATA[<p>工作上有使用 AR:&#160;Augmented Reality 的需求，上網找找看有沒有什麼不錯的套件，在 SocialCompare 這網站條列了現有 AR 套件的功能說明與比較 (參1)，經過&#46;&#46;&#46;</p>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) &#8211; 安裝 Vuforia</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>工作上有使用 <strong>AR:&nbsp;Augmented Reality</strong> 的需求，上網找找看有沒有什麼不錯的套件，在 SocialCompare 這網站條列了現有 AR 套件的功能說明與比較 (<a rel="noreferrer noopener nofollow external" href="http://socialcompare.com/en/comparison/augmented-reality-sdks" target="_blank" data-wpel-link="external" class="wpel-icon-right">參1<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)，經過一番比較挑中了 <strong>Qualcomm Vuforia</strong> 來實作，原因在於 ImageTarget 小於 100 的情況並且不使用特殊功能的情況下是免費的 (<a rel="noreferrer noopener nofollow external" href="https://developer.vuforia.com/target-manager" target="_blank" data-wpel-link="external" class="wpel-icon-right">參2<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)，這篇記錄一下安裝的過程。 </p>



<span id="more-3320"></span>



<p><strong>2016-07-07 更新：本篇為 3.x 版本，目前 Vuforia 以更新到 5.5.9，新版本使用方式請參考&nbsp;</strong></p>



<p><strong>Android Vuforia 系列：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/3639/android-vuforia-with-jpct-ae-1-%e5%9f%ba%e6%9c%ac%e7%af%84%e4%be%8b/" data-wpel-link="internal">Android Vuforia with jPCT-AE (1) – 基本範例</a></li><li><a href="https://noter.tw/3688/android-vuforia-with-jpct-ae-2-%e8%bc%89%e5%85%a5-obj-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (2) – 載入 obj 測試</a></li><li><a href="https://noter.tw/3735/android-vuforia-with-jpct-ae-3-%e8%bc%89%e5%85%a5-md2-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (3) – 載入 md2 測試</a></li><li><a href="https://noter.tw/3737/android-vuforia-with-jpct-ae-4-%e8%bc%89%e5%85%a5-3ds-%e6%b8%ac%e8%a9%a6/" data-wpel-link="internal">Android Vuforia with jPCT-AE (4) – 載入 3DS 測試</a></li><li><a href="https://noter.tw/3739/android-vuforia-with-jpct-ae-5-%e5%a4%9a%e9%87%8d%e6%a8%a1%e5%9e%8b%e8%bc%89%e5%85%a5%ef%bc%8c%e4%bb%a5-obj-%e7%82%ba%e4%be%8b/" data-wpel-link="internal">Android Vuforia with jPCT-AE (5) – 多重模型載入，以 obj 為例</a></li></ul>


<p>AR 的介紹小蛙就不多說了，這裡主要以記錄安裝過程為主，有興趣的朋友可以連結到參考資料或維基百科去看看更多說明。</p>
<p style="padding-left: 30px;"><strong>1. 上 Vuforia Vuforia Portal</strong> (<a href="https://developer.vuforia.com/" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">https://developer.vuforia.com/<span class="wpel-icon wpel-image wpel-icon-6"></span></a>)<br><a title="001.png" href="http://lh3.ggpht.com/-xcjhWVtRrCw/VIVroiprpZI/AAAAAAAAKik/tNthvK0LQzE/s0/001.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="pe2-photo aligncenter" title="001.png" src="//lh3.ggpht.com/-xcjhWVtRrCw/VIVroiprpZI/AAAAAAAAKik/tNthvK0LQzE/w500-o/001.png" alt="001.png"></a></p>
<p></p>
<p style="padding-left: 30px;"><strong>2. 點選 Download 後進入以下畫面</strong>，再點選「<span style="color: #0000ff;"><strong>Download Download SDK 3.0.9 for Windows/Mac/Linux</strong></span>」<br><a title="002.png" href="http://lh4.ggpht.com/-wXyxbq1kA0M/VIVro8nXbOI/AAAAAAAAKig/pTrdsIdq9BU/s0/002.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="pe2-photo aligncenter" title="002.png" src="//lh4.ggpht.com/-wXyxbq1kA0M/VIVro8nXbOI/AAAAAAAAKig/pTrdsIdq9BU/w500-o/002.png" alt="002.png"></a></p>
<p></p>
<p style="padding-left: 30px;"><strong>&nbsp; 3. 下載 SDK 需要登入</strong>，如果沒有帳號密碼點選「<span style="color: #0000ff;"><strong>Create account now</strong></span>」，登入後即可開始下載 SDK。<br><a title="003.png" href="http://lh3.ggpht.com/-0DPnttWpgZQ/VIVrosr_HhI/AAAAAAAAKiY/wpyeN7KM0EU/s0/003.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="pe2-photo aligncenter" title="003.png" src="//lh3.ggpht.com/-0DPnttWpgZQ/VIVrosr_HhI/AAAAAAAAKiY/wpyeN7KM0EU/w500-o/003.png" alt="003.png"></a>&nbsp; &nbsp; &nbsp;&nbsp;<a title="004.png" href="http://lh6.ggpht.com/-6dHP9w1YcOY/VIVrprDiWkI/AAAAAAAAKio/LNWUUZtJrHs/s0/004.png" target="_blank" rel="noopener nofollow external noreferrer" data-wpel-link="external"><img decoding="async" class="pe2-photo aligncenter" title="004.png" src="//lh6.ggpht.com/-6dHP9w1YcOY/VIVrprDiWkI/AAAAAAAAKio/LNWUUZtJrHs/w500-o/004.png" alt="004.png" height="336"></a></p>
<p></p>
<p style="padding-left: 30px;"><strong>4.&nbsp;安裝 Android SDK + 安裝/更新 ADT 到新版</strong><br>如果版本不符合 Eclipse 會跳出提示，這邊小蛙偷懶跳過不做了，可參考到&nbsp;<strong><a href="http://www.inote.tw/how-to-set-android-development-environment-with-android-sdk" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">[教學] 如何使用 Eclipse、Android SDK、ADT 配置 Android 開發環境 ？ @ 海芋小站<span class="wpel-icon wpel-image wpel-icon-6"></span></a></strong> (參4)</p>
<p style="padding-left: 30px;"><strong>5.&nbsp;安裝 Vuforia SDK</strong><br>解壓縮下載來的壓縮檔<span style="color: #ff00ff;"><strong>&nbsp;vuforia-sdk-android-3-0-9.zip</strong></span>，解壓縮後把所有的工具放在 <span style="color: #0000ff;"><strong>&lt;DEVELOPMENT_ROOT&gt;</strong></span> 目錄下，之後都會稱這個目錄為&nbsp;<span style="color: #0000ff;"><strong>&lt;DEVELOPMENT_ROOT&gt;</strong></span>，例如：放在&nbsp;C:\Program Files\Android 的話，<strong><span style="color: #0000ff;">&lt;DEVELOPMENT_ROOT&gt;</span></strong> 就代表 <span style="color: #ff00ff;"><strong>C:\Program Files\Android</strong></span>。這邊要注意的是，小蛙發現如果放的路徑中間有空白，可能在做 ndk-build 或其他動作的時候會發生錯誤，如果可以盡可能選擇沒有空白的路徑。</p>
<p style="padding-left: 30px;"><strong>6.&nbsp;安裝 Android NDK</strong><br>到 (<a href="https://developer.android.com/tools/sdk/ndk/index.html#Installing" target="_blank" rel="noopener noreferrer nofollow external" data-wpel-link="external" class="wpel-icon-right">參5<span class="wpel-icon wpel-image wpel-icon-6"></span></a>) 下載 NDK，小蛙的環境是 Windows 8.1 64 bit 選擇自己對應的版本下載，解壓縮到剛剛第 5 點提到的&nbsp;<strong><span style="color: #0000ff;">&lt;DEVELOPMENT_ROOT&gt;</span></strong>，因此整個結構會變成：</p>
<pre>  C:\Program Files\Android\
                           android-ndk\
                           android-sdk\
                           vuforia-sdk\</pre>
<p style="padding-left: 30px;"><strong>7. 設定 NDK</strong><br>在<span style="color: #ff00ff;"><strong> Eclipse -&gt; Window -&gt; Android -&gt; NDK -&gt; NDK Location </strong></span>設定成上述路徑，例如：小蛙的是: C:\Program Files (x86)\Android\android-ndk-r10c (好孩子不要學，參考上面第 5 點，改成中間沒有空白的，不然後面會出問題)。</p>
<p style="padding-left: 30px;"><strong>8.&nbsp;設定 vuforia QCAR 環境變數</strong><br><span style="color: #ff00ff;"><strong>Eclipse -&gt; Window -&gt; Preferences -&gt; Java -&gt; Build Path -&gt; Classpath Variables -&gt; New&#8230;</strong></span><br>Name : <span style="color: #0000ff;"><strong>QCAR_SDK_ROOT</strong></span><br>Path : <strong><span style="color: #0000ff;">C:/Program Files (x86)/Android/vuforia-sdk-android-3-0-9</span></strong> (換成自己的路徑)</p>
<p style="padding-left: 30px;"><strong>9. 設定在 Eclipse 專案中使用 QCAR 變數</strong><br>在要使用 <strong><span style="color: #ff00ff;">Vuforia 的專案中 -&gt; 滑鼠右鍵 -&gt; Properties -&gt; Java Build Path -&gt;&nbsp;Libraries -&gt; Add Variable&#8230; -&gt; QCAR_SDK_ROOT -&gt; Extend&#8230; -&gt; build / java / vuforia / Vuforia.jar -&gt; OK</span></strong><br>接著到 <span style="color: #0000ff;"><strong>Order and Export</strong></span> 把剛剛新增的 <strong><span style="color: #0000ff;">QCAR_SDK_ROOT</span></strong>&#8230; 打勾</p>
<p style="padding-left: 30px;"><strong>10.&nbsp;下載測試範例</strong><br>下載 (https://developer.vuforia.com/resources/sample-apps/features) 並解壓縮到&nbsp;<span style="color: #0000ff;"><strong>&lt;DEVELOPMENT_ROOT&gt;</strong></span><strong><span style="color: #ff00ff;">\vuforia-sdk-android-3-0-9\samples</span></strong></p>
<p style="padding-left: 30px;"><strong>11.&nbsp;匯入範例檔</strong><br><strong><span style="color: #ff00ff;">Eclipse -&gt; File -&gt; Import&#8230; -&gt; General -&gt; Existing Android Code Into Workspace&#8230;</span></strong><br>Root Directory : <strong><span style="color: #0000ff;">C:\Program Files (x86)\Android\vuforia-sdk-android-3-0-9\samples</span></strong><br>Projects : <span style="color: #0000ff;"><strong>VuforiaSamples-3-0-5_0</strong></span><br>怕把原始檔改壞，複製一分到自己的工作區域，把 <span style="color: #ff0000;">Copy projects into workspace</span> 打勾</p>
<p style="padding-left: 30px;"><strong>12.&nbsp;執行 VuforiaSample</strong><br><strong><span style="color: #ff00ff;">Run As -&gt; Android Application&nbsp;</span></strong><br>專案可以跑起來，但會得到以下錯誤</p>
<pre>BUILD FAILED
 D:\Workspace\PureProjectNew\VuforiaSamples\CopyVuforiaFiles.xml:4: D:\Workspace\build\lib\armeabi-v7a does not exist.</pre>
<p style="padding-left: 30px;"><strong>13.&nbsp;修改設定檔 CopyVuforiaFile.xml</strong></p>
<pre>&lt;fileset dir="C:/Program Files (x86)/Android/vuforia-sdk-android-3-0-9/build/lib/armeabi-v7a"/&gt;
存檔後，Project -&gt; Clean... -&gt; Clean projects selected below VuforiaSamples
Clean 完之後按照上個步驟執行就可以了！</pre>
<p style="padding-left: 30px;"><strong>14.&nbsp;使用範例圖片測試</strong><br>https://developer.vuforia.com/resources/sample-apps/features，每個 sample 點進去會有 PDF 的範例圖片可以測試，依照每個範例的名稱開啟對應的圖片。</p>
<p>經過一番折騰，Qualcomm Vuforia 已經順利安裝起來了，這系列文章預估會有以下內容：</p>


<p><strong>Qualcomm Vuforia&nbsp;</strong><strong>系列：</strong></p>



<ul class="my-li bg-darkblue wp-block-list"><li><a href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1/" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) – 安裝 Vuforia</a></li><li><a href="https://noter.tw/3347/qualcomm-vuforia-%e6%95%99%e5%ad%b8-2-create-image-target/" data-wpel-link="internal">Qualcomm Vuforia 教學 (2) – Create Image Target</a></li><li><a href="https://noter.tw/3360/qualcomm-vuforia-%e6%95%99%e5%ad%b8-3-%e6%9b%bf%e6%8f%9b%e8%8c%b6%e5%a3%ba-android-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (3) – 替換茶壺 – Android 版本</a></li><li><a href="https://noter.tw/3371/qualcomm-vuforia-%e6%95%99%e5%ad%b8-4-%e4%bd%bf%e7%94%a8-android-ndk-%e7%89%88%e6%9c%ac%e4%b8%a6%e9%96%8b%e5%95%9f%e5%a4%9a%e9%87%8d%e5%81%b5%e6%b8%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (4) – 使用 Android NDK 版本並開啟多重偵測</a></li><li><a href="https://noter.tw/3392/qualcomm-vuforia-%e6%95%99%e5%ad%b8-5-%e6%9b%bf%e6%8f%9b%e8%8c%b6%e5%a3%ba-android-jni-%e7%89%88%e6%9c%ac/" data-wpel-link="internal">Qualcomm Vuforia 教學 (5) – 替換茶壺 – Android JNI 版本</a></li><li><a href="https://noter.tw/3403/qualcomm-vuforia-%e6%95%99%e5%ad%b8-6-3d-model-obj-h/" data-wpel-link="internal">Qualcomm Vuforia 教學 (6) – 3D model -&gt; .obj -&gt; .h</a></li></ul>



<p>敬請期待 (希望不會又偷懶不記錄 &#8230;)</p>



<h2 class="para wp-block-heading"><strong>參考資料</strong></h2>



<ul class="my-li bg-darkblue wp-block-list"><li><a rel="noreferrer noopener nofollow external" aria-label="Augmented Reality SDK Comparison&nbsp;@ SocialCompare (在新分頁中開啟)" href="http://socialcompare.com/en/comparison/augmented-reality-sdks" target="_blank" data-wpel-link="external" class="wpel-icon-right">Augmented Reality SDK Comparison&nbsp;@ SocialCompare<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li><li><a rel="noreferrer noopener nofollow external" aria-label=" (在新分頁中開啟)" href="https://developer.vuforia.com/target-manager" target="_blank" data-wpel-link="external" class="wpel-icon-right">Target Manager @ Vuforia Developer Portal<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li><li><a rel="noreferrer noopener nofollow external" aria-label=" (在新分頁中開啟)" href="https://zh.wikipedia.org/wiki/%E6%93%B4%E5%A2%9E%E5%AF%A6%E5%A2%83" target="_blank" data-wpel-link="external" class="wpel-icon-right">擴增實境 @ 維基百科<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li><li><a rel="noreferrer noopener nofollow external" aria-label=" (在新分頁中開啟)" href="http://www.inote.tw/how-to-set-android-development-environment-with-android-sdk" target="_blank" data-wpel-link="external" class="wpel-icon-right">[教學] 如何使用 Eclipse、Android SDK、ADT 配置 Android 開發環境 ？ @ 海芋小站<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li><li><a rel="noreferrer noopener nofollow external" aria-label=" (在新分頁中開啟)" href="https://developer.android.com/tools/sdk/ndk/index.html#Installing" target="_blank" data-wpel-link="external" class="wpel-icon-right">Installing the NDK @ Android Developers<span class="wpel-icon wpel-image wpel-icon-6"></span></a></li></ul>
<p>這篇文章 <a rel="nofollow" href="https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/" data-wpel-link="internal">Qualcomm Vuforia 教學 (1) &#8211; 安裝 Vuforia</a> 最早出現於 <a rel="nofollow" href="https://noter.tw" data-wpel-link="internal">記下來</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://noter.tw/3320/qualcomm-vuforia-%e6%95%99%e5%ad%b8-1-%e5%ae%89%e8%a3%9d-vuforia/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
