App Development

FRIENDS VR WITH GOOGLE VR SDK FOR ANDROID

Refer to Google VR SDK for Android to develop Friends VR app with it. Most of it is similar to creating VR apps using Google VR SDK for Android, but you need to keep the following in consideration:

Development Tips

  • GL State Check
    When you change the Presentation mode, OnsurfaceCreatedis called. Then, you need to initialize GL state.
    When the GvrView is attached to the Presentation, this causes a recreation of the underlying Surface. 
    You need to make sure that your app properly handles multiple calls to onSurfaceCreated, reconstructing the necessary GL state with the new context. 
  • Reorientation Compensation  
    Reorientation compensation is needed when resetHeadTracker will be called.

    You need to reset your pose matrix in your launcher. As your first frame, get the pose matrix, remove pitch to flatten it to the horizon, invert the matrix, then correct your ongoing head poses by always multiplying by this invert matrix.

FRIENDS VR WITH GOOGLE VR SDK FOR UNITY

Refer to Google VR SDK for Unity to adapt an existing Unity 3D app or build your own VR experience from scratch for Friends VR with it. Most of it is similar to creating VR experience using Google VR SDK for Unity, but you need to keep the following in consideration: 

 

To develop VR apps for LG 360 VR, Google VR for Unity version 0.8.0 is recommended. It works up to Google VR for Unity version 0.9.1. Please refer to here to download the SDK.

 

  • Distortion Correction Setting
    1. In GvrMain Prefab, select an "Inspector" window.
    2. Under "General Settings", check that the distortion correction is set to "Native" as below:
     

    Gvr_setting_updated.png 

 

  • Default Orientation Setting
    1. In File > Build Settings, select Android as the platform.
    2. Click Player SettingsUnder "Resolution and Presentation", make sure that the default orientation is set to "Portrait" as below:

    UnitySDK2.png 
 
  • Minimum API Level Setting
    1. In File Build Settings, select Android as the platform.
    2. Click Player Settings. Under "Other Settings", check that the Minimum API Level is set to "Android 6.0 'Marshmallow' (API level 23)" as below image.
     
    SettingsMinimumAPILevel.png 

MODIFYING THE ANDROID MANIFEST 

To develop your Friends VR app, the following modifications need to be made to the Android Manifest file. 

 

  • LG 360 VR needs to be declared to display your VR app on LG 360 VR home screen. 
    <action android:name="com.lge.home.vr.LG_360VR_APP" />

 

  • Category name in an intent filter needs to be modified as below to hide your VR app on the smartphone's home screen. Remove category Launcher and add category Info.
    <category android:name="android.intent.category.LAUNCHER" />
    <category android:name="android.intent.category.INFO" /> 

 

  • Activity name needs to be declared as below to exclude your VR app from the recently used apps.
    <activity android:excludeFromRecents="true" />
Navigation