Android Question Access to #AdditionalRes from app code

jotaele

Member
Licensed User
Longtime User
Hi:

I have a folder in the main folder of the app that is used for a library, included in the app with the clause:

B4X:
#AdditionalRes: ..\Resources

If I want to access the files included in the #AdditionalRes folder from code, how can I do it?

I tried a lot of commands using a File Object but I cannot do it, and I dont want to replicate resources.
 

jotaele

Member
Licensed User
Longtime User
You can use XmlLayoutBuilder library to access the resources.

I tried but didn't work for me.

The folder of the images is [Main Folder]/Resources/drawable/

Inside this folder there is a lot of images.

I tried to get one with this code, but not work.

B4X:
#AdditionalRes: ..\Resources

Dim z As XmlLayoutBuilder
z.GetDrawable("a.png")

OR

Dim z As XmlLayoutBuilder
z.GetDrawable("drawable/a.png")

OR

Dim z As XmlLayoutBuilder
z.GetDrawable("Resources/drawable/a.png")

OR

Dim z As XmlLayoutBuilder
z.GetDrawable("../Resources/drawable/a.png")

What it the correct path?
 
Upvote 0
Top