Setup Guide Android Native API
Project Setup
Create a new Android Studio Application Project (There is also a working SampleProject bundled in this SDK, where all these steps are already made)
Copy the file
libs/wikitude_native_sdk.aar
into the libs folder of your module. (project root/app/libs)Open
build.gradle (Module: app)
, add thewikitude_native_sdk.aar
as a dependency and tell gradle to search the libs folder, like in the code below.
android {
...
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile (name: 'wikitude_native_sdk', ext:'aar')
...
}
repositories {
flatDir{
dirs 'libs'
}
}
- If you already purchased a license, please set the applicationId to the package name you provided us with.
defaultConfig {
applicationId "xxxx"
}
- Add the following permissions and features to your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
Note: Since Android 6.0+ you need to make sure your app has the camera runtime permission before calling
WikitudeSDK.onCreate()
.
- Also in the Android manifest define following config changes for the activity which adds the OpenGL view
<activity
android:name="YOUR_PACKAGE_NAME.YOUR_ACTIVITY_NAME"
android:configChanges="orientation|keyboardHidden|screenSize" />
- Read this chapter on how to obtain a free trial key, which you will later pass to the Wikitude Native SDK.