Is there any way to tell what folder a drawable resource was inflated from?
<p>Does anyone know of a way to tell which folder Android system will resolve to when I request a particular drawable from the Resources (<code>drawable-long</code> vs. <code>drawable-notlong</code>, for example)?  I want to make sure it's loading resources the way I would expect it to (for instance, to make sure the Tattoo is really <code>ldpi</code> and not <code>mdpi</code> since it's right on the borderline).</p>

<p>I could always print out the intrinsic size of the drawable after I fetch it from Resources, and check that against the various image sizes I have, but that's kind of a pain.  Plus, my company allows its clients to skin their app before it's released, so after it's been skinned I won't be able to rely on that method.</p>

<p>I tried using <code>Resources.getName(resId)</code> but that doesn't give the folder name, and as far as I know you can get a <code>AssetFileDescriptor</code> for the resource but you can't get an actual filename.</p>

<p><strong>UPDATE:</strong>
Since asking this question I have discovered that you can access many of the <a href="http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources" rel="nofollow">resource qualifier names</a> through the <code>Configuration</code> and <code>DisplayMetrics</code> classes (both accessible via <code>getResources()</code>).  <code>DisplayMetrics</code> can give you the <code>ldpi</code>/<code>mdpi</code>/<code>hdpi</code> designation, and <code>Configuration</code> can give you <code>small</code>/<code>normal</code>/<code>large</code> screen size, <code>long</code>/<code>notlong</code> aspect ratio, locale, mobile network codes, and other hardware information.  However, this still does not positively confirm that you are getting the resources you expect if you have a complicated resource set.  It also does not protect you from bugs that report the incorrect values, like the Motorola Droid bug where the <code>DisplayMetrics</code> reports the wrong <code>xdpi</code> and <code>ydpi</code> (it reports 96dpi where the real value is more like 265dpi!  Terrible bug.).</p>
