implement specific file to a class in android
<p>I have developed an application in android. I have a file 'Constants.java' implemented to an activity. This file contains constant values for application. I need to change this constants file according to device resolution.</p>

<p>Is there a way where I can build a preprocessor, where in I can check the resolution of device, and implementa particular file accordingly, 
example:
implement constants.java file for 240x320 and implement constants1.java file for 320x480</p>

<p>I tried fetching the integer values from strings.xml file, but it gives me a null pointer exception at <code>Resources res = getResources()</code>, when getResources() is called outside a method.</p>

<p>please help!!</p>
