RodionovID Posted May 30, 2024 Posted May 30, 2024 Hello. I have a build of my Unity VR application for Vive Focus 3 that appears in the list of VR apps and works fine in case when it was installed from apk manually. But when I try to install it programmatically it gets to the list of 2D apps and doesn't work properly. AndroidManifest.xml for this app looks as follows: <?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="30" android:compileSdkVersionCodename="11" android:installLocation="auto" package="com.my.package.name" platformBuildVersionCode="30" platformBuildVersionName="11"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/> <uses-feature android:glEsVersion="0x00030002"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-feature android:name="android.hardware.touchscreen" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false"/> <uses-permission android:name="vive.wave.vr.oem.data.OEMDataRead"/> <uses-permission android:name="vive.wave.vr.oem.data.OEMDataWrite"/> <application android:extractNativeLibs="true" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:theme="@style/Theme.WaveVR.Black"> <activity android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:enableVrMode="@string/wvr_vr_mode_component" android:hardwareAccelerated="false" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.htc.vr.unity.WVRUnityVRActivity" android:resizeableActivity="false" android:screenOrientation="landscape"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="com.htc.intent.category.VRAPP"/> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true"/> <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true"/> </activity> <meta-data android:name="unity.splash-mode" android:value="0"/> <meta-data android:name="unity.splash-enable" android:value="true"/> <meta-data android:name="unity.launch-fullscreen" android:value="true"/> <meta-data android:name="unity.allow-resizable-window" android:value="false"/> </application> </manifest> Programmatically installation perfoms by another app that serves as launcher to the first app. Launcher is a common Android application that was written using .NET MAUI framework. It appears in the list of 2D apps on device. Here is installation script from this launcher: var context = Android.App.Application.Context; Java.IO.File apkFile = new Java.IO.File(apkPath); Intent intent = new Intent(Intent.ActionInstallPackage); var uri = Microsoft.Maui.Storage.FileProvider.GetUriForFile(context, context.ApplicationContext.PackageName + ".fileProvider", apkFile); intent.SetDataAndType(uri, "application/vnd.android.package-archive"); intent.AddFlags(ActivityFlags.NewTask); intent.AddFlags(ActivityFlags.GrantReadUriPermission); intent.AddFlags(ActivityFlags.ClearTop); intent.PutExtra(Intent.ExtraNotUnknownSource, true); intent.PutExtra(Intent.ExtraReturnResult, true); MainActivity.Instance.StartActivityForResult(intent, requestCode); My guess is that some data from AndroidManifest.xml is lost/not used during installation. As I know, this entry makes application to show up as a vr app on device: <category android:name="com.htc.intent.category.VRAPP" /> It looks like installation from launcher ignores this category. I will appreceate any help with this issue.
VIVE_chengnay Posted June 1, 2024 Posted June 1, 2024 Hi @RodionovID, May I know after programmatically install, your app in Library is in which category? Check top right corner of Library. Your app is built from Unity? Your AndroidManifest.xml is not modified from our SDK's template?
VIVE_chengnay Posted June 1, 2024 Posted June 1, 2024 On 5/30/2024 at 11:46 PM, RodionovID said: Here is installation script from this launcher: var context = Android.App.Application.Context; Java.IO.File apkFile = new Java.IO.File(apkPath); Intent intent = new Intent(Intent.ActionInstallPackage); var uri = Microsoft.Maui.Storage.FileProvider.GetUriForFile(context, context.ApplicationContext.PackageName + ".fileProvider", apkFile); intent.SetDataAndType(uri, "application/vnd.android.package-archive"); intent.AddFlags(ActivityFlags.NewTask); intent.AddFlags(ActivityFlags.GrantReadUriPermission); intent.AddFlags(ActivityFlags.ClearTop); intent.PutExtra(Intent.ExtraNotUnknownSource, true); intent.PutExtra(Intent.ExtraReturnResult, true); MainActivity.Instance.StartActivityForResult(intent, requestCode); Your app is built from Android Studio?
RodionovID Posted June 3, 2024 Author Posted June 3, 2024 Hello, @VIVE_chengnay. After install my app in 2D category. Yes, my app is built from Unity. I believe that my app's AndroidManifest.xml is not modified. Can you share a link to your SDK's template? My launcher app is build from Visual Studio. I have another guess. My launcher app is parent activity for VR app during installation. Because of launcher app is 2D, VR app somehow inherits category from it. Is this possible?
VIVE_chengnay Posted June 3, 2024 Posted June 3, 2024 Hi @RodionovID, You can find the AndroidManifest.xml template from Library\PackageCache\com.htc.upm.wave.xrsdk@<version>\Runtime\Android\AndroidManifest.xml. 3 minutes ago, RodionovID said: I have another guess. My launcher app is parent activity for VR app during installation. Because of launcher app is 2D, VR app somehow inherits category from it. Is this possible? You did mention if you manually install from "adb install", your app is installed as 3D?
RodionovID Posted June 3, 2024 Author Posted June 3, 2024 @VIVE_chengnay, I didn't use "adb install". I installed my app from device directly. In settings->storage->file explorer I chose apk file and installed it. In this case my app in VR category.
VIVE_chengnay Posted June 3, 2024 Posted June 3, 2024 Hi @RodionovID, Could you collect log for further investigation? adb logcat > filename Collect before your app launch until your launcher app launches another app.
RodionovID Posted June 3, 2024 Author Posted June 3, 2024 @VIVE_chengnay, Here is a public link to the log file: https://drive.google.com/file/d/1tnTbdjgZzIXsIDliO0XegBD56SqHXN0a/view?usp=drive_link
VIVE_chengnay Posted June 3, 2024 Posted June 3, 2024 Hi @RodionovID, I didn't find the starting point of where you start your apps. Could you provide your apps' package name?
RodionovID Posted June 3, 2024 Author Posted June 3, 2024 @VIVE_chengnay Application package name: com.stemgames.vics.studio Launcher package name: com.companyname.vics_science_studio_launcher
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now