采用Android工作室Vuforia [英] Using Android Studio with Vuforia

查看:2033
本文介绍了采用Android工作室Vuforia的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我如何在窗口8在Android Studio中运行一个Vuforia样品

1 - 下载,exctract样本,删除文件的.project和project.properties
2 - 在Android工作室:导入项目,下一个,下一个...
3 - 下载和放大器;安装Android NDK <一href="http://developer.android.com/tools/sdk/ndk/index.html">http://developer.android.com/tools/sdk/ndk/index.html
4 - 下载和放大器;安装Cygwin http://cygwin.com/
5 - 编辑文件JNI / Android.mk

  LOCAL_SRC_FILES = C:/ Vuforia-SDK /编译/ lib中/ $(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES:= C:/ Vuforia-SDK /建设/包括
 

在这里Vuforia-SDK是你的vuforia SDK

6打开cmd,在项目文件夹,并做NDK建造
在机器人工作室7,集团公司在项目结构,模块,YourModuleName,相关性,加罐子,选择正确的路径vuforia SDK对我来说是:

  C:\ Vuforia-SDK \编译\ java的\ QCAR \ QCAR.jar
 

8构建和放大器;运行Android的工作室项目
9玩得开心!

*不要忘了NDK和放大器PATH变量; Cygwin的

解决方案

 阅读我们的入门指南上设置Java SDK,Android SDK和NDK的说明:

 https://developer.vuforia.com/resources/dev-guide/getting-started-android-native-sdk
确保您已经从安装可用的Andr​​oid Studio的最新版本:

http://developer.android.com/sdk/index.html

使用Android SDK管理器(从Android的Studio中),以获得最新的Andr​​oid SDK和Android平台和构建工具

推出Android工作室

选择文件 - &GT;导入项目...并浏览到的根目录
品尝Vuforia项目要打开
继续导入向导对话框(单击下一步,下一步),直到找到与此消息的页面:

或者,您可以填写以下表中的实际路径图:
点击编辑

进入实际路径Vuforia.jar库(位于下您vuforia_install_dir /编译/爪哇/ vuforia)

在项目视图中,在项目右键单击并展开视图层次结构,以便找到Vuforia.jar下的应用程序和GT; SRC&GT;主要
在Vuforia.jar右击打开上下文菜单

点击在上下文菜单中的添加库...选项

另外,如果你不能找到Vuforia.jar在项目层次:
在项目单击鼠标右键,选择打开模块设置

选择应用程序
然后选择依存关系选项卡

点击+按钮,添加一个文件相关性,并浏览到Vuforia.jar文件

你的Andr​​oid Studio项目目录下的应用程序/ src目录/主文件夹下创建一个名为jniLibs文件夹

从复制armeabi-V7A文件夹(包括位于里面的libVuforia.so文件)vuforia_install_dir /建/ lib目录的应用程序/ src目录/主/ jniLibs文件夹

在你的项目根生成的目录结构应该是:
/应用
/ src目录
/主要
/ jniLibs
/ armeabi-V7A
libVuforia.so

清理并重建项目

运行在设备上的应用程序
 

Here is how i run a Vuforia Sample on Android Studio on Window 8

1 - download, exctract sample, remove files .project and project.properties
2 - On Android Studio : Import project, next, next ...
3 - download & install android NDK http://developer.android.com/tools/sdk/ndk/index.html
4 - download & install cygwin http://cygwin.com/
5 - edit the file jni/Android.mk

LOCAL_SRC_FILES = C:/Vuforia-sdk/build/lib/$(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES := C:/Vuforia-sdk/build/include

where Vuforia-sdk is your vuforia sdk

6- open cmd in your project folder and do "ndk-build"
7- in android studio, clic on project structure, modules, "YourModuleName", Dependencies, add jars, select the correct path to vuforia sdk for me it was :

C:\Vuforia-sdk\build\java\QCAR\QCAR.jar    

8- build & run your project in Android Studio
9- have fun !

*don't forget the PATH variable for the ndk & cygwin

解决方案

Read our Getting Started Guide for instructions on setting up the Java SDK, Android SDK and NDK:

 https://developer.vuforia.com/resources/dev-guide/getting-started-android-native-sdk
Make sure you have installed the latest version available of Android Studio from:

http://developer.android.com/sdk/index.html 

Use the Android SDK Manager (from within Android Studio) to get the latest Android SDK and Android Platform and Build tools

Launch Android Studio

Select File - > Import Project ... and browse to the root directory of the 
sample Vuforia project you want to open
Proceed in the Import Wizard dialog (click Next, Next) until you reach a     page with this message:

"Alternatively, you can fill in the actual path map in the table below":
click to edit

enter the actual path to the Vuforia.jar library (which is located under your vuforia_install_dir/build/java/vuforia)

In the Project view, right-click on the Project and expand the view hierarchy so to locate the Vuforia.jar under app > src > main
right-click on Vuforia.jar to open the context menu

click on the "Add as library..." option in the context menu 

Alternatively, if you cannot locate the Vuforia.jar in your project hierarchy:
right-click on the Project and select "Open Module Settings"

select "App"
then select the "Dependencies" tab

Click on the "+" button to Add a File Dependency and browse to the Vuforia.jar file

Create a folder called "jniLibs" under the "app/src/main" folder under your Android Studio project directory

Copy the "armeabi-v7a" folder (including the libVuforia.so file located inside it) from the "vuforia_install_dir/build/lib" to the "app/src/main/jniLibs" folder

the resulting directory structure under your project root should be:
/app
/src
/main
/jniLibs
/armeabi-v7a
libVuforia.so

Clean and rebuild the project

Run the app on your device

这篇关于采用Android工作室Vuforia的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆