Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

A.1. Project Setup

Hadi Tavakoli edited this page Aug 2, 2019 · 7 revisions

Project Setup

If you are planning to use AR technology in your next AIR application, you need to use AIR SDK 30+.

  • iOS 10.0+
  • Android 19+
  • AIR 30+
  • swf-version 37+

You need to make the following changes to your project's .xml manifest file:

Assets

You can store your AR html/js files as assets in your application, i.e in the File.applicationDirectory location. However, you can load AR worlds through http addresses or File.documentsDirectory too.

Hint: if you are using File.documentsDirectory on Android, you need to ask for ExternalStorage permission using our PermissionCheck ANE.

Besides the AR html/js files, you also need to package the following assets when including the Wikitude SDK on Android:

  • architect.js
  • exit.png
  • sdk_logo-1.png
  • wikitude_icon.png

You can check out the demo project assets here.

Manifest setup

<!-- For Android -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.CAMERA" />

<!-- Tell the system this app requires OpenGL ES 2.0. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />

<!-- rear facing cam -->
<uses-feature android:name="android.hardware.camera" android:required="true" />

<!-- users location -->
<uses-feature android:name="android.hardware.location" android:required="true" />

<!-- accelerometer -->
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />

<!-- compass -->
<uses-feature android:name="android.hardware.sensor.compass" android:required="true" />

<!-- do not support small resolution screens -->
<supports-screens
	android:smallScreens="false" android:largeScreens="true"
	android:normalScreens="true" android:anyDensity="true"
	android:xlargeScreens="true" />
	
<application>

	<!-- ...Your other settings... -->

	<activity
		android:name="com.myflashlabs.ar.MyArchitectView"
		android:configChanges="orientation|keyboardHidden|screenSize"
		android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>

	<activity android:name="com.wikitude.architect.BrowserActivity" />
	<activity
		android:name="com.wikitude.tools.activities.MediaPlayerActivity"
		android:screenOrientation="landscape" >
	</activity>		
</application>







<!-- For iOS -->
<!--iOS 10.0 or higher can support this ANE-->
<key>MinimumOSVersion</key>
<string>10.0</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Access to your Geo Data is needed to display augmented reality images on your screen.</string>
		
<key>NSCameraUsageDescription</key>
<string>Access to the camera is needed to display augmented reality content on top of your camera image.</string>






<!-- Embedding the ANEs -->

<extensionID>com.myflashlab.air.extensions.ar</extensionID>

<!-- 
	you need this ANE to take care of the permissions before 
	starting your AR Experience.
	http://www.myflashlabs.com/product/native-access-permission-check-settings-menu-air-native-extension/
-->
<extensionID>com.myflashlab.air.extensions.permissionCheck</extensionID>

<!-- dependency ANEs https://github.com/myflashlab/common-dependencies-ANE -->
<extensionID>com.myflashlab.air.extensions.dependency.overrideAir</extensionID>

Wikitude's iOS SDK is using Dynamic Frameworks and to be able to use this framework in your app, do the following steps:

  1. Download Wikitude SDK V7.2.1 and locate the framework file: WikitudeSDK.framework.
  2. Now create a folder at the root of your AIR project and name it Frameworks. Notice the first capital letter. Then, copy the .framework file into this folder.
  3. When packaging your .ipa file, make sure the Frameworks folder is also packaged with your app. Like any resources that you include in your project, this folder must be present in your build too.

Hint: After packaging your app, to double check if the framework is available in your app packaging, open the final .ipa file and you should be able to see the Framework folder at the root of your app content.