I have a question/issue that might be simple to solve but I cannot figgure it out. I am trying to make my own app that has an images as target and the creates a transparent video.
However, my camera is not starting, all i see is the "trial" background from wikitude.
final StartupConfiguration config = new StartupConfiguration( key );
this.architectView.onCreate( config );
this.architectView.onPostCreate();
try {
this.architectView.load(menuEntry);
} catch (IOException e) {
e.printStackTrace();
}
}
The sample project is working, but I cannot see figgure out exactly where/how the camera is opened. Can someone push me in the right direction?
Thanks for any help!
G
Gabriele Boccone
said
over 8 years ago
Hi, did you get any particular message in the logcat window? Does your application open the camera before starting the AR View? One possible explanation is that the main HTML file of your AR world has a non-transparent background. The rendering of this HTML file could be hiding the camera.
M
MADI
said
over 8 years ago
My logcat gives this outmout which might be relevant:
04-10 15:14:16.445 11482-11482/com.designit.augmented E/? Device driver API match
04-10 15:14:17.475 11482-11482/com.designit.augmented W/AwContents? nativeOnDraw failed; clearing to background color.
04-10 15:14:17.550 11482-11499/com.designit.augmented E/libEGL? called unimplemented OpenGL ES API
04-10 15:14:17.560 11482-11499/com.designit.augmented E/libEGL? called unimplemented OpenGL ES API
04-10 15:14:17.720 11482-11482/com.designit.augmented W/AwContents? nativeOnDraw failed; clearing to background color.
04-10 15:14:18.180 11482-11508/com.designit.augmented E/AndroidProtocolHandler? Unable to open asset URL: file:///android_asset/ade.js
...
Im not sure I understand your question about the camera - That is my whole problem, I am not opening it at all. (However, I cannot open my device's camera app at the same time as this app is running in the background)
I dont think the issue is in the html/css/js documents. I am just using the example code from your app here, without any modifications. (Example 7 video with bonus transparency)
When I start my app I have the top border saying "Scan target #1(surfer) or #2(biker)" and two small preview pictures. After 10 secounds this top-border disapears, as specified in the javascript file.
Where the camera feed should be, is just a black screen with the text "trial" written all over it.
Thanks for the feedback Gabriele
M
MADI
said
over 8 years ago
The line with "W/AwContents? nativeOnDraw failed; clearing to background color" could in my opinion be the reason for the issues. In this post https://jira.appcelerator.org/browse/TIDOC-1548 they have the same error, albeit another program altogether. Someone mentions this:
This issue seems to be related to the way the webview is created. I created a module, that creates the webview inside a fragment. When created this way, the error does not occur.
I am not sure how the webview is created when using the wikitude architectview, but it could be related as the samples are created in an fragment, or at least, the camera is?
When I call the this.architectView.getCurrentCamera() it return with "REAR" which seems to correct to me. So the camera might very well be opened, it is just hidden/not drawn/redndered as you suggest in your reply Garbriele. However I am not sure how to solve this issue.
G
Gabriele Boccone
said
over 8 years ago
Have you tried scanning the target? If the problem is the camera rendering, you should see the augmentation on the screen, even if the background is black.
K
Kevin K
said
over 8 years ago
You must put this in the Lifecyle Method in the same class but not in onCreate:
protected void onPostCreate( final Bundle savedInstanceState ) {
super.onPostCreate( savedInstanceState );
if ( this.architectView != null ) {
this.architectView.onPostCreate();
try {
this.architectView.load("<index html in assets folder>");
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
And it works fine :)
l
laurens koppenol
said
over 8 years ago
Hi guys,
I have the exact same problem. I copied the first cam (surfer) example from the sample app and started my own activity according to the few instructions in the android starting tutorials. I do see the surfer header which means the html is loaded.
i also got the called unimplemented OpenGL ES API error.
Put an empty template project next to the sample project in the sdk zip! There are quite a few people that ran into a similar problem as the 'hints' given in the developer guide are a bit hard to find.
@Override
public void onResume() {
super.onResume();
this.architectView.onResume();
}
G
Gabriele Boccone
said
over 8 years ago
Thank you for the information.
B
Bikramjit Kar
said
about 8 years ago
thanks! This was driving me nuts!
for anyone else with the same issue, refer to these lines in the docs:
It is very important to notify the ArchitectView about life-cycle events of the Activity. Call architectView's onCreate(), onPostCreate(), onPause(), onResume(), onDestroy() inside your Activity's lifecycle methods.
basically, you need to override each of those activity lifecycle methods and call the architectView's methods inside them. like so:
MADI