Is it possible to include meta-data in my Android Manifest file for only a specific API level?
I want the following line only be considered when the app is built on a phone with Android API >= 30:
<meta-data android:name="disable_batch_scanning" android:value="true" />
I tried to set a boolean variable under res/values/bools.xml like this:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isLess31">true</bool>
</resources>
And use it with the tag: android:enabled="@bool/isLess31"
Therefore, I also created a values-v31 folder where is set isLess31
to false
But this does not seem to work.
Is there another way that disable_batch_scanning
is only executed for older Android APIs?