Log in or register to post comments

CQAR Unity Player (not activity) integration to Eclipse

April 18, 2012 - 3:53am #1

I am building an application with unity for android. The app contains some of the android activities as well as unity game in one of them. At the moment I have implemented it by extending QCARPlayerActivity but that is not exactly what I want. I would like to have it in one of my activities as a view so I can add other components as well.
I succeeded to implement this with a normal camera in unity as described here but I couldn't make it with ARCamera.
I've tried this:

QCARUnityPlayer m_UnityPlayer = new QCARUnityPlayer(this);
m_UnityPlayer.initQCARRendering();

But it crashes on m_UnityPlayer.initQCARRendering(); giving an error:

04-18 12:17:08.628: E/AndroidRuntime(28460): FATAL EXCEPTION: main
04-18 12:17:08.628: E/AndroidRuntime(28460): java.lang.UnsatisfiedLinkError: initQCARRendering
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at com.qualcomm.QCARUnityPlayer.QCARUnityPlayer.initQCARRendering(Native Method)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at com.test.integration.UnityPlayerActivity.onCreate(UnityPlayerActivity.java:33)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.os.Looper.loop(Looper.java:130)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at android.app.ActivityThread.main(ActivityThread.java:3683)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at java.lang.reflect.Method.invoke(Method.java:507)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-18 12:17:08.628: E/AndroidRuntime(28460): 	at dalvik.system.NativeStart.main(Native Method)

Does anyone have an idea what's wrong? Or succeeded implementing this?

Re: CQAR Unity Player (not activity) integration to Eclipse

April 19, 2012 - 12:26pm #2

There isn't an initQCARRendering method in the 1.5 version of the extension.

I'm not sure this is going to work... There's a lot more initialization work going on in Java for QCAR than the typical Unity application. You can safely extend the QCAR activities, but you can't try to reproduce the setup in a separate activity.

- Kim

Log in or register to post comments