Log in or register to post comments

Unity plugin with native intefaces (java)

September 5, 2013 - 3:59am #1
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)

November 25, 2014 - 6:35am #8

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"

 

Unity plugin with native intefaces (java)

September 6, 2013 - 5:24am #7

Got it, thanks! We are looking into it.

 

Unity plugin with native intefaces (java)

September 5, 2013 - 8:49am #6

Sure, you can send me the project via PM.

 

Unity plugin with native intefaces (java)

September 5, 2013 - 8:34am #5

Dear Alessandro,

We are indeed in the second case you describe : "we start with a Native activity at first, then switch to Unity and then back to native "

Thank you again for your support,

Christophe.

P.S. : Do not hesitate to ask me if you want us to send you a unitary project which reproduces the issue.

Unity plugin with native intefaces (java)

September 5, 2013 - 8:15am #4

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)

September 5, 2013 - 6:22am #3

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)

September 5, 2013 - 5:37am #2

Hi Cristophe,

have you checked this article, which provides a way of extending Vuforia-based Unity activities and customizing with Android views ?

https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse

This may perhaps provide some extra hints, by comparing with what you are doing in your project setup.

Log in or register to post comments