# Android: how to add an xml file to res/xml

**URL:** <https://forums.unrealengine.com/t/android-how-to-add-an-xml-file-to-res-xml/435056>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, xml, question\
**Created:** [October 5, 2018, 12:27am UTC](https://forums.unrealengine.com/t/android-how-to-add-an-xml-file-to-res-xml/435056 "2018-10-05T00:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [October 5, 2018, 12:27am UTC](https://forums.unrealengine.com/t/android-how-to-add-an-xml-file-to-res-xml/435056/1 "2018-10-05T00:27:07Z")

</div>

Hi there,

I need to provide file access between my app and the photo’s app. What I’m trying to do is load a photo from the gallery or camera.

This used to work until I upgraded to 24 when I ran into a permissions problem.

The solution seems to be to identify my app as a FileProvider - as described here:

However I’m not sure how to approach:

```
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="my_images" path="images/"/>
    <files-path name="my_docs" path="docs/"/>
</paths>

Put the <paths> element and its children in an XML file in your project. For example, you can add them to a new file called res/xml/file_paths.xml.

```

Seems that I could modify the apk post build but this is going to get old fast. Perhaps there’s a location I can put the file in the build directory or elsewhere and get it copied across when packaging?

-

---

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [October 5, 2018, 8:04pm UTC](https://forums.unrealengine.com/t/android-how-to-add-an-xml-file-to-res-xml/435056/2 "2018-10-05T20:04:55Z")

</div>

I can see the build system moving files around in UEDeployAndroid, and also that the APL contents appear in the Intermediate folder.

Two questions I guess:

1. If I copy a file to the relevant  
place in Intermediate does it  
magically appear in the APK

2. How do I copy a source file to  
Intermediate during the build  
procress? It looks like file copying  
is in the core deployment cs files  
but not the plugin cs files so I’m hoping that I can add files to a  
list somewhere with a desired  
destination.

---

<div class="post-metadata">

**Author:** ![tomotor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tomotor](https://forums.unrealengine.com/u/tomotor)\
**Post date:** [June 12, 2019, 7:23pm UTC](https://forums.unrealengine.com/t/android-how-to-add-an-xml-file-to-res-xml/435056/3 "2019-06-12T19:23:59Z")

</div>

Dealing with this in a plugin scenario, assuming that you already added the \_APL.xml file in your build.cs, put the file\_paths.xml in the same folder as the APL.xml file and you can add this code to your (filename)\_APL.xml

```
     <root xmlns:android="http://schemas.android.com/apk/res/android">
     ...
           <!-- optional files or directories to copy to Intermediate/Android/APK -->
          <resourceCopies>
              <copyFile src="$S(ProjectDir)/Plugins/(YourPlugin)/Source/(YourPlugin)/file_paths.xml"
        				dst="$S(BuildDir)/res/xml/file_paths.xml" />
          </resourceCopies>
</root>
```
