How To Add a License Key To Your Vuforia App
来源:互联网 发布:金蝶软件购买 编辑:程序博客网 时间:2024/05/18 23:55
Vuforia apps each utilize a unique license key obtained from the Vuforia License Manager. This article will show you how to add the key to your Vuforia Unity, Android, iOS and UWP projects.
Vuforia应用程序每个都使用从Vuforia许可证管理器获取的唯一许可证密钥。 本文将向您展示如何将密钥添加到您的Vuforia Unity,Android,iOS和UWP项目中。
If you don’t have a license key, See: Vuforia License Manager
Adding a License Key to a Unity app 将许可证密钥添加到Unity应用程序
Your license key should be added to the App License Key field on the VuforiaConfiguration asset accessible from the ARCamera’s Inspector panel via the Open Vuforia Configuration button. You can also search for VuforiaConfiguration in the Project panel.
您的许可证密钥应添加到VuforiaConfiguration资产的应用许可证密钥字段,可从ARCamera的Inspector面板通过Open Vuforia Configuration按钮访问。 您还可以在“项目”面板中搜索VuforiaConfiguration。
Adding a License Key to a native iOS app
Use the setInitParameters method
1
Vuforia::setInitParameters(mVuforiaInitFlags,”“);
Example:
In SampleApplicationSession.mm of the Vuforia iOS samples
Line 132
1、将许可证密钥添加到原生iOS应用程序
使用setInitParameters方法
1
Vuforia:: setInitParameters(mVuforiaInitFlags,“”);
例:
在Vuforia iOS样品的SampleApplicationSession.mm中
第132行
// Initialise Vuforia// (Performed on a background thread)- (void)initVuforiaInBackground{// Background thread must have its own autorelease pool@autoreleasepool {Vuforia::setInitParameters(mVuforiaInitFlags," your_license_key ");// Vuforia::init() will return positive numbers up to 100 as it progresses// towards success. Negative numbers indicate error conditionsNSInteger initSuccess = 0;do {initSuccess = Vuforia::init();} while (0 <= initSuccess && 100 > initSuccess);if (100 == initSuccess) {// We can now continue the initialization of Vuforia// (on the main thread)[self performSelectorOnMainThread:@selector(prepareAR) withObject:nil waitUntilDone:NO];}else {// Failed to initialise Vuforia:if (Vuforia::INIT_NO_CAMERA_ACCESS == initSuccess) {// On devices running iOS 8+, the user is required to explicitly grant// camera access to an App.// If camera access is denied, Vuforia::init will return// Vuforia::INIT_NO_CAMERA_ACCESS.// This case should be handled gracefully, e.g.// by warning and instructing the user on how// to restore the camera access for this app// via Device Settings > Privacy > Camera[self performSelectorOnMainThread:@selector(showCameraAccessWarning) withObject:nil waitUntilDone:YES];}else {// Vuforia initialization errorNSError * error;switch(initSuccess) {case Vuforia::INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_LICENSE_ERROR_NO_NETWORK_TRANSIENT", nil) code:initSuccess];break;case Vuforia::INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_LICENSE_ERROR_NO_NETWORK_PERMANENT", nil) code:initSuccess];break;case Vuforia::INIT_LICENSE_ERROR_INVALID_KEY:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_LICENSE_ERROR_INVALID_KEY", nil) code:initSuccess];break;case Vuforia::INIT_LICENSE_ERROR_CANCELED_KEY:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_LICENSE_ERROR_CANCELED_KEY", nil) code:initSuccess];break;case Vuforia::INIT_LICENSE_ERROR_MISSING_KEY:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_LICENSE_ERROR_MISSING_KEY", nil) code:initSuccess];break;default:error = [self NSErrorWithCode:NSLocalizedString(@"INIT_default", nil) code:initSuccess];break;}// Vuforia initialization error[self.delegate onInitARDone:error];}}}}
2、Adding a License Key to a native Android app
Use the setInitParameters() method:
1
Vuforia.setInitParameters(mActivity, mVuforiaFlags, ” your_license_key “);
Example:
In com.vuforia.samples.SampleApplication
File SampleApplicationSession.java
Line 336
将许可证密钥添加到本地Android应用程序
使用setInitParameters()方法:
1
Vuforia.setInitParameters(mActivity,mVuforiaFlags,“your_license_key”);
例:
在com.vuforia.samples.SampleApplication
文件SampleApplicationSession.java
第336行
// An async task to initialize Vuforia asynchronously.private class InitVuforiaTask extends AsyncTask<Void, Integer, Boolean>{ // Initialize with invalid value: private int mProgressValue = -1; protected Boolean doInBackground(Void... params) { // Prevent the onDestroy() method to overlap with initialization: synchronized (mShutdownLock) { Vuforia.setInitParameters(mActivity, mVuforiaFlags, " your_license_key "); do { // Vuforia.init() blocks until an initialization step is // complete, then it proceeds to the next step and reports // progress in percents (0 ... 100%). // If Vuforia.init() returns -1, it indicates an error. // Initialization is done when progress has reached 100%. mProgressValue = Vuforia.init(); // Publish the progress value: publishProgress(mProgressValue); // We check whether the task has been canceled in the // meantime (by calling AsyncTask.cancel(true)). // and bail out if it has, thus stopping this thread. // This is necessary as the AsyncTask will run to completion // regardless of the status of the component that // started is. } while (!isCancelled() && mProgressValue >= 0 && mProgressValue < 100); return (mProgressValue > 0); } }}
3、Adding a license key to a native UWP app
File: AppSession.cpp
将许可证密钥添加到本机UWP应用程序
文件:AppSession.cpp
原文网址:https://library.vuforia.com/articles/Solution/How-To-add-a-License-Key-to-your-Vuforia-App.html
- How To Add a License Key To Your Vuforia App
- How to add RD license servers to a win8 host
- How to get a TexturePacker license Key 如何获得免费的 TexturePacker license Key
- How to Add Splash Screen in Your iOS App
- How to add a Primary Key on a Oracle view
- How to add a new key on android
- [Headset] How to add a headset music key
- HOW TO ADD A NEW A WIDGET AREA TO YOUR WORDPRESS THEME
- How to Add a Icon to your Oracle Apps Toolbar item
- How to add a Custom Pull to Refresh in your iOS Application
- How to add a new key from kernel level to java level
- How to add a button to PreferenceScreen
- How to add CoverFlow Effect on your iPhone App – OpenFlow
- KB: Sample Code - How to add video to your UI
- How To Add Breakpad To Your Linux Application
- How to Reset or Change Microsoft Office 2007 Product License Key or Volume License Key (VLK)
- How To Add a TwoFields Validator
- How to add a .dll file ?
- DI和IoC
- Linux中的权限管理
- jvava 代码创建接口 通过jni实现C的调用步骤
- [NOIP模拟赛]老师
- ThreadPoolExecutor核心实现原理和源码解析<一>
- How To Add a License Key To Your Vuforia App
- 使用Jxl实现Excel导入导出
- 修改网站404,500的错误页面
- 初次运行 Git 前的配置
- 在Django中使用JavaScript代替模板接收并处理数据
- eclipse快捷键
- javaseday31(图片上传服务端 客户端单线程)
- JAVA-初步认识-第二章-变量的基本演示
- ATMEGA16读取DS18B20温度,1602显示,并用proteus仿真,成功。