Setup Guide Titanium Module Android
The Augmented Reality View
From a technical point of view the SDK adds a UI component called AR View, similar to a web view. In contrast to a standard web view the AR View can render augmented reality content.
Content developed for the AR View is written in JavaScript and HTML. It is important to understand that the .html
and .js
files for the AR view are different from the Titanium JavaScript files.
SETUP - How to
To use the Wikitude Module in a Titanium project download and install the module from Wikitude download page
For more information please visit the documentation from Appcelerator on how to use Titanium modules. After the module was added to the project, make sure that the module is also listed in the project's module configuration.
Wikitude Sample App - Getting Started quickly
Wikitude offers an fully-configured example application as Titanium app hosted on GitHub. The application demonstrates the usage of the Wikitude Titanium Module as well as the usage of the ARchitectWindow
. Furthermore the application includes several ARchitect World examples which are described in more detail in the Example section of this documentation.
Building the Wikitude Sample App for Titanium
- Download or clone the Titanium Sample App from GitHub and extract the zip file
Create new Workspace
Select "Import Project" in the new empty workspace created in step 2
From all the options select
Existing Mobile Project
Point it to the directory
WikitudeTitaniumSample
found in the location where you unpacked the zip file from step 1The warning you will receive is expected as the Application GUID will be generated upon launching your application.
Download and extract the Wikitude Titanium modules
copy the
modules
folder to the root directory of your projectClick Run for the platform of your choice
Note: Although the Wikitude SDK is also JavaScript based you cannot call Wikitude function in your Titanium environment or vice versa.
JavaScript Interface
To create and launch an ARchitect World, we provide a file called ARchitectWindow.js
. Please have a look at the SampleApplication how the ARchitectWindow
is used.
You can interact between Titanium and ARchitect JavaScripts using
document.location = "architectsdk://yourhost?value1=foo&value2=bar"
and customize the onUrlWasInvoked
method in the ARchitectWindow.js
. That way you can pass arguments e.g. as JSON string from Wikitude's ARchitectWindow
into your Titanium project to handle custom events.
We recommend to separate the JavaScript files of your AR experience and the rest of your application. By doing so you it is easier to handle any logic necessary for the augmented reality interface in the Wikitude's JavaScript and logic related to the general user interface in the JavaScript parts of Titanium.
You can load Augmented Reality experiences developed with the Wikitude SDK from the application's asset folder or from any web url (compare SampleApplication and the Launch World via Url
option).
Note:
Passing arguments is only possible when the file is located on a remote server. A call like http://yourdomain/yourfile.html?yourparam=foo
will not work when loaded from assets folder.
Location Strategy
The Sample Application uses the Location Provider
from Titanium to determine and set the user's location. Have a look at this.locationListener
and addEventListener('resume|pause|destroy')
in the ArchitectWindow.js
to customize location accuracy and update rate, if required.
Trial and commercial license
By default the Wikitude SDK comes with no valid license key. Read this chapter on how to obtain a free trial key.