You have to create a configuration file. First, you replace the boolean value by a variable in your manifest:
SetApplicationAttribute(android:largeHeap,"@bool/largeheap")
Then you create a config file (its name doesn't matter) that contains true or false and you put it in the folder corresponding to the targeted screen. For example in objects/res/drawable-xhdpi or objects/res/layout-xlarge (see
this doc for further details).
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="largeheap">true</bool>
</resources>