Resource Utilities - How to use

In the latest release we added a new experimental component called “Resource Utilities”.
Below is a example how you can use this component.


Note:
DO NOT USE THIS COMPONENT FOR PRODUCTION! ONLY FOR TESTING!


Example:
The file name must be current: “strings.xml” and the file must be stored in the assets folder.
The component does current not work with companion.

And the content must only be strings like below:


Correct:

<string name=“en_forward_target”>Hello</string>
<string name=“es_forward_target”>Hola</string>
<string name=“de_forward_target”>Hallo</string>

<string name=“en_404”>There was a problem</string>
<string name=“es_404”>Había un problema</string>
<string name=“de_404”>Es ist ein Fehler aufgetreten</string>


Wrong:

<?xml version=“1.0” encoding=“utf-8”?>
<resources>
<string name=“en_forward_target”>Hello</string>
<string name=“es_forward_target”>Hola</string>
<string name=“de_forward_target”>Hallo</string>

<string name=“en_404”>There was a problem</string>
<string name=“es_404”>Había un problema</string>
<string name=“de_404”>Es ist ein Fehler aufgetreten</string>
</resources>


(Device Tools: Component can be found in ‘Device’ category.)

It is recommended to use this component just for testing and not for production since the blocks will be changed soon for a stable component.

Last notice:
There can be merge conflict with other strings.xml files content from librarys.
Mean > It’s possible that your added string name is not merged correct through the apk compiler.
The result is then that your resource can not be found.
The output will then be your used text at “If Resource Not Found Use”…

This will be fixed if the component is stable!

7 Likes