By montandon
on Thu, 09/05/2013 - 10:59
Dear Vuforia Support, We are developping a mobile application (IOs / Android) which uses both native interfaces (XCode / Java) and the Unity QCAR Plugin (with Unity 4.1.2). In this application, we need to switch between the native and the Unity views (i.e. navigating from one to the other). It works perfectly on IOs. But, for Android, as long as we go back to the native views (from Unity view), the application closes itself after about 2s.Note that we have to inherit from QCARPlayerActivity class for generating this application. When trying to do the same thing with a standard Unity project (without QCAR and thus inheriting from UnityPlayerActivity), we do not have any problem. The last point is that we found a way to get around the issue : it consists in destroying the Unity activity when going back to native interface (in the OnPause() callback of the QCARPlayerActivity class). Unfortunately, that forces Unity to initialize again each time we go back in the Unity view, which could be quite long depending on the Unity project. We can provide you unitary tests we made (.apk and Eclipse project). Thank you for your support, Christophe Montandon - Diotasoft.
Unity plugin with native intefaces (java)
Hi Cristophe,
have you checked this article, which provides a way of extending Vuforia-based Unity activities and customizing with Android views ?
Unity plugin with native intefaces (java)
Dear Alessandro,
Thank you for your answer and for the link you provide.
Unfortunately, we already used this link and we didn't manage to correct the issue.
Best regards,
Christophe.
Unity plugin with native intefaces (java)
I see.
Could you describe the exact workflow, i.e.:
do you start first with Unity view and then you launch a native Activity on top of it ?
or do you start with a Native activity at first, then switch to Unity and then back to native ?
other ?
Unity plugin with native intefaces (java)
Dear Alessandro,
Unity plugin with native intefaces (java)
Sure, you can send me the project via PM.
Unity plugin with native intefaces (java)
Got it, thanks! We are looking into it.
Unity plugin with native intefaces (java)
Hi, it seems this issue can be resolved by simply adding the android:process attribute to the Unity(Vuforia) activity in the AndroidManifest.xml:
android:process=":vuforia"