I tried making sample application which is replica of the code "1.1 Image On Target". I see the "Scan Target #1" on top, but camera live view is not coming.
I have copied contents of : samples/1_Image$Recognition_1_Image$On$Target in my "assets" folder. I have used path "samples/1_Image$Recognition_1_Image$On$Target/index.html" for loading AR view (this.architectView.load) Below is the code I used. Please tell if you find any error.
// call mandatory live-cycle method of architectView
this.architectView.onPostCreate();
try {
String test = "samples/1_Image$Recognition_1_Image$On$Target/index.html";
// load content via url in architectView, ensure '<script src="architect://architect.js"></script>' is part of this HTML file, have a look at wikitude.com's developer section for API references
this.architectView.load( test );
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
private String getWikitudeSDKLicenseKey() {
// TODO Auto-generated method stub
final String WIKITUDE_SDK_KEY = "WsD6V6YuOXKbiyaf69VFN4kTxjFR81obhLyRNMfOXdHaYIfdzDSAWaQ7qNbtP59Y7wtPnlY5N00k0FlKbVJanDljfG13XgUMWzJTbbQKok4doRciQIFy7WfDWSxwLxovbcnV+yHOKoSdJdXyLb6mbxRZzuaJUyIDJnwK/r2KKadTYWx0ZWRfX3DpNxb1VlVy7rmzJjNTYjnarVHD7i3avQZCaUvReYkINnqQg5DbrTb1Uip9+D/VLGUK/GdkWf9ODbKTHoE3B+aueiAboiruoi20Z78Dc7LVNkeUhjNlet61HoAFAIahCkrVxIht/2TZ5nAimpA1Y/YqrjDgLQ6Tvq45raTYmSrCZ3xQZmDTxUDhUSPAsY6tUBj9XvPGewqqrQzDHB+vb14Als8NtXfkrTeZSz0w+Vu1EfRAFFP5MR+qfVtuAj+xIJRCnXCMGmaPUSRtW7l0j96IfX0UN2OnhITLOJwhpi0Qi2AU31LNcDuDnMfjIaKtkV1uCgYZSIvGOnec57r30JNipt2pm2w0kUrTFZsdBLlGy7qPgnLokTNx0bTIDsMtBr6e3yPXws2gWHa5zkxUxSsozf5C7yg79H9GcTukJuQEh9Dahgb7IpKGs/VfUkVui3tKVx0zmyMDEkNV/XFPUrOy0mxnS4GWwwG/zqOXE9HzSuuL7zgUZ3I=";
return WIKITUDE_SDK_KEY;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
} ______________________________________________
G
Gabriele Boccone
said
almost 9 years ago
Hi.
I can't find any error in your code just by looking at it.
Are you getting error messages or exceptions when calling the "onCreate()" method? If the camera is not available, the method should throw a RuntimeException.
If everything else is working, another issue could be the background color of your HTML file. If the background is not transparent, then the webiew may be covering the camera preview.
Yogesh Mourya