"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

QCARUnityPlayer in Subview

Hi.. I'm trying to display the QCARUnityPlayer in one part of the display.. basically it should do the same es suggested in here with the normal unityplayer (works fine) [url]http://forum.unity3d.com/threads/98315-Using-Unity-Android-In-a-Sub-View[/url] any ideas? i would like to have the unity qcar at the top and a surfaceview at the bottom. i tried smthg like: [code] public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); surfaceView = (SurfaceView)findViewById(R.id.surfaceView1); ... etc. } [/code] the qcar player is always in front and i can't see the surfaceview thx a lot in advande..

This probably isn't possible with the default samples, which render the video background under the hood. You may want to try with the BackgroundTextureAccess sample, however.

i tried it like this: [CODE] public class ViewexampleActivity extends Activity{ private UnityPlayer m_UnityPlayer; private QCARPlayerSharedActivity mQCARShared; /** Called when the activity is first created.

You need to extend these two classes: com.qualcomm.QCARUnityPlayer.QCARPlayerActivity com.qualcomm.QCARUnityPlayer.QCARPlayerNativeActivity Don't try to work with the QCARPlayerSharedActivity directly, you'll be missing some important steps in the classes above. - Kim

gabrielmarcos2001

Thu, 06/28/2012 - 22:52

Have anybody accomplished this? I have the same scenario and I'm having the same error than dd.

Any help will be appreciated.

 

sanylop22

Wed, 05/15/2013 - 10:45

Help Please!

Hello, I would like to show a button (Android Button) in front of my AR cam, and I can do it...

If I can't do the vuforia screen smaller, how could I put a Button in front of the screen?

 

Thank you!!

After much trial and error, I got things working fine with a subview - actually it is a fragment inside an activity which has it's own view. This is in the fragment onCreateView:

 

I, too, have been trying to put the unity/vuforia into it's own fragment within a regular android activity.  And I, too, am hitting noting but trouble.  If at all possible, could you post the entire code for the fragment and main activity?  Please??

Cynthia, the code I posted goes in onCreateView of your Fragment.

The layout is simple - the unity_container is just a FrameLayout with match_parent for height and width. This is inside the root fragment layout which is also just a FrameLayout with match_parent height and width.

Sorry for the mistake. You are not being stupid. I said put the code in "onCreateView", but it actually goes in "onViewCreated".  This method passes in the "view" parameter that I am using there.

 

 

yes, success. Thank you grennis!

For those also trying this, follow the thread instructions but ADD the following information to the process:

Make sure, in the Manifest, that the activity that will be starting the app is NOT sending native events to dalvik, i.e.

Well, worked as you had it.  There is still something I'm not getting, that is obvious, about how the qcar/unity setup works.  If you've seen this before, any advice would be appreciated.

Well, you know what? Doesn't really matter at this point if I can't get multiple side-by-side fragments, since I can do a complex fragment layout instead and see if that will work just as well.

Hi,

Sorry, right now I'm a little busy with other things.  I don't have the time right now to strip down a sample.  I will consider it later, but likely that's still a few months from now.

Could you kindly please help me with integrating Unity and Vuforia into Android Studio.. Basically all i want to achieve right now is to have a menu system designed in Android Studio and from that menu options the user goes into the AR scene . I am totally new to this.