Start a new topic

ArchitectView is null

ArchitectView is null

1 person has this problem


Hi,

I am a rookie and I am trying to use wikitude for the first time. I am using Android Studio. In the main layout.xml, I have the following lines of code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">

<com.wikitude.architect.ArchitectView android:id="@+id/architectView" android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</LinearLayout>

 

In the mainactivity, on create, i am using the following lines of code:

this.architectView = (ArchitectView) findViewById(R.id.architectView);
final StartupConfiguration config = new StartupConfiguration(key);
this.architectView.onCreate(config);
Boolean test = ArchitectView.isDeviceSupported(this);

 

The runtime is not able to render the architectView. Please can you hint what I am missing? I have added wikitudesdk.arr file in the libs and also added the following lines of code in the build.gradle file

 

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.0"

defaultConfig {
applicationId "com.example.hariprasauthr.arwiki"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: )
compile (name: 'wikitudesdk', ext:'aar')
compile 'com.android.support:appcompat-v7:23.0.0'
}

repositories {
flatDir{
dirs 'libs'
}
}


 

Hi,

Please check the Android set-up guide to get details on how to set-up the sample app and/or your own app. For details on how to work with Android Studio, please check here.

Greetings

Nicola

Thanks for the response, Nicola. I did start the set up with that guide. As mentioned in my post, I have done all the steps mentioned and would like to know if I have missed something. 

Regards,

Hari

Hi Hariprasauth,

you need to set the ContentView to the layout file containing the architectView before you use findViewById to retrieve the ArchitectView instance.

Please take a look at the Android Example Application to see a full working setup. (AbstractArchitectCamActivity.java and SampleCamActivity.java)

Best regards,
Simon
Login or Signup to post a comment