- Home /
Google Cardboard and touch
We are developing an Android VR application that has some touch interactions before we put the cellphone in the Cardboard.
From my understanding, the Cardboard SDK captures touch events and forwards them to Unity using another Android activity. On the first touch the status bar appears and the event is not forwarded to the application. If a second touch is performed while this status bar is visible, it is then sent to the application. Waiting some time hides the status bar, and then the same behavior occours as in the first touch.
Therefore I would like to know the following:
Why does the status bar shows on touch when adding the Cardboard SDK? Is this a Cardboard Setting? Can it be disabled?
Why does the touch event only work when this status bar is visible? Can they be always forwarded?
Edit: This is the single activity in the Android manifest:
<activity android:name="com.google.vrtoolkit.cardboard.plugins.unity.UnityCardboardActivity" ... >
...
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
Answer by Vitor Nexo · Mar 31, 2015 at 02:29 AM
It turns out Fibrum has an SDK as well which is compatible with touch, so we ended up using it to solve the problem.
Answer by dolims · Mar 25, 2015 at 02:11 AM
If your phone's version of Android is older than 4.4 (API level 19, KitKat), then this is what happens, because Android did not add the "immersive" mode till then, which is what lets fullscreen apps receive touches without the status bar showing up first.
Thank you for your answer @dolims. I am indeed using an older version of Android (4.1.2, API 16). However, we are able to hide the upper status bar (we are not interested in hiding the lower system bar), and receive touch events normally only when the Cardboard SD$$anonymous$$ is not in the project.
This is a weird behavior, because we are able to install third party VR applications in this same phone. They accept toch event normally, not requiring multiple taps to work, neither showing the system bar.
Do the other VR apps show the status bar or are they full screen? Could be that the Cardboard SD$$anonymous$$ is doing it wrong. Could you mention one of the 3rd party VR apps you referred to? I'd like to compare.
They don't show the status bar. We tested some fibrum apps like roller coaster VR and Zobie Shooter VR
Answer by Maksen · May 25, 2015 at 01:22 PM
Hello everyone! I solved this problem! You must install these settings when VR is not needed.
I am using the latest version of the SD$$anonymous$$ - Google VR SD$$anonymous$$ 1.1 and this "CarboardScript" is not present. I even went down the BaseVRDevice.cs and it has no function/variable corresponding to "Tap is Trigger". How do I accept physical touch on a button when in VR mode?
Answer by Ice52 · Oct 11, 2015 at 12:36 PM
Following on from what @dolims said, I have been having the same problem with the latest version of the cardboard SDK with Android 4.3.
commenting the line:
<meta-data android:name="IMMERSIVE_MODE" android:value="true"/>
in the AndroidManifest.xml found in the Plugins->Android folder appears to have solved the problem.
Thanks @dolims for pointing me in the right direction.