cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing local files

RecoveryVR
Level 4
Hi all,

I'm looking to store video files locally on the Quest and access them from the apk through their file path.

To be clear, I'm trying to access the internal storage on the Quest via an installed apk. This would be a video stored in the movies folder or something similar that can be viewed inside the Quest through the Gallery. I am aware that the file path of the apk is available and looks something like /storage/emulated/0/Android/data/com.company.name/files but this is not what I need.

I am aware of obb expansion files but we are simply using too many external files to fit inside the size constraints of an apk + obb (approx. 7GB). This app will not be pushed to the store either so I'm not worried about any of those constraints, we will hopefully be using the enterprise edition.

Any help would be greatly appreciated!

EDIT: Solved
17 REPLIES 17

Anonymous
Not applicable

Did you figure anything out for this?

I'm having an issue when I set minimum Android level to 23 (as required by Oculus' servers)--the video expansion files that used to play now do not. I'm requesting read/write external in my manifest. Highest installed Android is 29 if that makes any difference.

You may need to use this path - Application.persistentDataPath
 

urko.sanchez
Level 2

Hello,
I've been having this same problem for a few days. I have a project where I show 360º videos. They were working correctly a few weeks ago and now they are not. I think I'm having problems with the access permissions to read the videos inside the "/storage/emulated/0/Videos" that I put manually through a string. Any suggestions to try to fix the problem?

Anonymous
Not applicable

It looks like adding android:requestLegacyExternalStorage="true" to the manifest allows the traditional method of accessing the file system to work. 

Sadly, my problems have not stopped there. Especially if you're using AVPro, you might find this ongoing thread between me and RenderHeads informative: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/776

That did it for me! Thanks!

I am able to play files from the path:

/storage/emulated/0/IXM/Dennis_V2_Export_360FOV_60fps_TB_25_sec.mp4

where IXM is a folder I created on the Quest 2 storage, same level as Android, Downloads or Movies.

 

This is the full custom manifest I used:

 

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="REDACTED" platformBuildVersionCode="29" platformBuildVersionName="10">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
    <uses-feature android:glEsVersion="0x00030000"/>
    <supports-gl-texture android:name="GL_KHR_texture_compression_astc_ldr"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-feature android:name="android.hardware.microphone" android:required="false"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_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-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1"/>
    <uses-feature android:name="oculus.software.handtracking" android:required="false"/>
    <uses-permission android:name="com.oculus.permission.HAND_TRACKING"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application android:allowBackup="false" android:extractNativeLibs="true" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_sec_config" android:requestLegacyExternalStorage="true">
        <activity android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="com.oculus.intent.category.VR"/>
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
            <meta-data android:name="android.notch_support" android:value="true"/>
            <meta-data android:name="com.oculus.vr.focusaware" android:value="true"/>
            <meta-data android:name="android.notch_support" 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="notch.config" android:value="portrait|landscape"/>
        <meta-data android:name="unity.build-id" android:value="f9d86e1d-da2b-4f34-ac63-2b099cfad14d"/>
        <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
        <meta-data android:name="com.unity.xr.oculus.LowOverheadMode" android:value="false"/>
        <meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
        <meta-data android:name="com.oculus.handtracking.frequency" android:value="LOW"/>
    </application>
</manifest>

DirtyFred
Level 3

Hi,

Can you please tell us how did you fix the issue? I have the same. 

Thank you

I used this manifest:

 

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="REDACTED" platformBuildVersionCode="29" platformBuildVersionName="10">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
    <uses-feature android:glEsVersion="0x00030000"/>
    <supports-gl-texture android:name="GL_KHR_texture_compression_astc_ldr"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-feature android:name="android.hardware.microphone" android:required="false"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_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-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1"/>
    <uses-feature android:name="oculus.software.handtracking" android:required="false"/>
    <uses-permission android:name="com.oculus.permission.HAND_TRACKING"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application android:allowBackup="false" android:extractNativeLibs="true" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_sec_config" android:requestLegacyExternalStorage="true">
        <activity android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="landscape" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="com.oculus.intent.category.VR"/>
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true"/>
            <meta-data android:name="android.notch_support" android:value="true"/>
            <meta-data android:name="com.oculus.vr.focusaware" android:value="true"/>
            <meta-data android:name="android.notch_support" 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="notch.config" android:value="portrait|landscape"/>
        <meta-data android:name="unity.build-id" android:value="f9d86e1d-da2b-4f34-ac63-2b099cfad14d"/>
        <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
        <meta-data android:name="com.unity.xr.oculus.LowOverheadMode" android:value="false"/>
        <meta-data android:name="com.oculus.supportedDevices" android:value="quest|quest2"/>
        <meta-data android:name="com.oculus.handtracking.frequency" android:value="LOW"/>
    </application>
</manifest>

Thank you! It worked for me. 🙂