Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How should I connect the vive focus bluetooth with vzbutton ?
#6
(10-03-2020, 04:15 PM)wmlabsteam Wrote: Yes, We are using the VZFit SDK to develop the Unity game which can run in vive focus. Thank you for your providing. Throuth your tips, we  begin to adjust the AndroidManifest.xml.

However, we found the other AndroidManifest in Wave VR SDK. We try to merge two scripts, but the two main activities will conflict with each other.

Our game can not be successfully launched when setting "com.virzom.pluginapp.MainActivity" as main activity.

On the other hand, if we set "com.htc.vr.unity.WVRUnityVRActivity" as main activity, "mediaNext" property will not work.

Is there any better way to have two main activities?

This is our AndroidManifest.xml after merging: https://imgur.com/3NlzJ1o

Ah, that is an interesting problem.

You will need a different way to access the VZ Button than our SDK's MainActivity.

The VZ Button presents as a standard bluetooth keyboard to Android, but you can't just read it with Unity's Input Manager because it emits special media keycodes.  The up button emits "media previous" while the down button emits "media next".  Our MainActivity has code that can receive those events, and present them through VZPlugin.ButtonUp() and VZPlugin.ButtonDown() in our SDK.  

If you need to use HTC's main activity, you could try to subclass that into your own main activity in Java, and add the same kind of event handling we did.  Then you could modify ButtonUp() and ButtonDown() to call on your activity instead of calling on ours.

I've attached the Java code for our simplified MainActivity and the necessary companion MyReceiver for you to try that.  If you're lucky you can just extend HTC's main activity class instead of UnityPlayerActivity.


Attached Files
.zip   pluginapp.zip (Size: 1.69 KB / Downloads: 2)
Reply


Messages In This Thread
RE: How should I connect the vive focus bluetooth with vzbutton ? - by emalafeew - 10-03-2020, 04:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)