Hello,
I've successfully built a Unity QCAR project and imported it to Eclipse. I want to run the QCARUnityPlayer in a sub view in android so that I can add extra controls and menus using Android. The problem is in my main Activity. When I extend Activity I get the following error:
11-16 15:34:25.931: W/dalvikvm(16057): No implementation found for native Lcom/qualcomm/QCAR/QCAR;.onSurfaceCreated ()V
11-16 15:34:25.961: W/dalvikvm(16057): threadid=11: thread exiting with uncaught exception (group=0x40c631f8)
11-16 15:34:25.961: E/AndroidRuntime(16057): FATAL EXCEPTION: GLThread 612
11-16 15:34:25.961: E/AndroidRuntime(16057): java.lang.UnsatisfiedLinkError: onSurfaceCreated
11-16 15:34:25.961: E/AndroidRuntime(16057): at com.qualcomm.QCAR.QCAR.onSurfaceCreated(Native Method)
11-16 15:34:25.961: E/AndroidRuntime(16057): at com.qualcomm.QCARUnityPlayer.QCARUnityPlayer.onSurfaceCreated(QCARUnityPlayer.java:39)
11-16 15:34:25.961: E/AndroidRuntime(16057): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1446)
11-16 15:34:25.961: E/AndroidRuntime(16057): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
I've imported all of the necessary libraries but it doesn't work. Is there another way to use android controls overlayed over the QCAR activity.Please help me out I'm in a dead end.
Overlaying androi data over QCARUnityPlayer
Hi, have a look at this Post:
https://ar.qualcomm.at/content/unity-how-can-i-extend-unitys-android-activity
it explains step-by-step what you need to do to get the project up and running in Eclipse and how to add android views on top.
Overlaying androi data over QCARUnityPlayer
AlessandroB you posted:
Overlaying androi data over QCARUnityPlayer
Here you go:
https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse
Overlaying androi data over QCARUnityPlayer
Thank you very much you have really saved me.
Overlaying androi data over QCARUnityPlayer
You're welcome.
Overlaying androi data over QCARUnityPlayer
I would like to make one more question. The method that you've described works perfectly. Now I've overlayed my Android Content over vuforia content. What I have is a linear layout that takes up 30% of the screen's width while the rest is left for interaction with the Unity 3D model.
Overlaying androi data over QCARUnityPlayer
Hi, have you tried with android:gravity instead of android:layout_gravity ?
Overlaying androi data over QCARUnityPlayer
I am pasting here the main.xml layout that I inflate and attach under the parent view; it is a linear layout and it shows a textView and a Button both aligned to the right (as an example of how to customize layout positioning, such as center, bottom, top, left/right, etc.):
Overlaying androi data over QCARUnityPlayer
Again thank you very much this did the trick. Also I would like to add someething for the other users.
Overlaying androi data over QCARUnityPlayer
You're welcome.
And thanks for the extra information on Unity raycast.
Overlaying androi data over QCARUnityPlayer
Hello again, this time I'm trying to call android methods from within unity. The documentation from unity suggests the following code:
Overlaying androi data over QCARUnityPlayer
Hi, two things you can already try to fix:
1- your function is called "ToggleMenu" but you seem to invoke "toggleMenu" (pay attention to the capital "T");
Overlaying androi data over QCARUnityPlayer
Hi, sorry for that but my function is called toggleMenu my mistake while writing the question.
Overlaying androi data over QCARUnityPlayer
Hi I've finally managed to solve this issue as well. The correct methodology is to create a static Activity in your main Android project and call it currentActivity. After this in your oncreate method you set the currentActivity to this the following code demonstrated that:
Overlaying androi data over QCARUnityPlayer
Hey, glad to hear that you found the trick with it!
I am absolutely sure this post will be helpful to other QCAR - Unity developers.
Overlaying androi data over QCARUnityPlayer
Hi mr21 I have read your post below of calling the android method from unity.
I have 2 question