I would like to have another string.xml in the values folder.
I want to keep the urls in a different file so are not editable. My plan is to have a default url in those files, commit the files and add them to git ignore.
I've tried creating an url.xml file in the values folder and add the following items:
<resources>
<item name="device_ip_address" type="string">0.0.0.0</item>
</resources>
I tried also with strings:
<string name="device_ip_address_key" translatable="false">0.0.0.0</string>
But when I try to get the string in the PreferenceScreen for example, I get a compilation error:
<PreferenceScreen
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference
app:key="@string/device_ip_address_key"
app:title="@string/device_ip_address_title"
app:summary="@url/device_ip_address"
app:defaultValue="@url/device_ip_address"
app:enabled="true"
/>
</PreferenceScreen>
or in the activity:
val myUrl = getString(R.string.device_ip_address)
Any idea how I can achieve this? Thanks