Why NoSuchMethodError Exception is thrown if API-jar has this method and implementation
<pre><code>File f = new File(fullPath);            
long freeSpace = f.getFreeSpace();
</code></pre>

<p>I am using above snippet in android app. 
My app compiles fine, with sdk-15 jar.</p>

<p>The android phone where I run the app is Froyo</p>

<p>I get following error at runtime</p>

<pre><code>      java.lang.NoSuchMethodError: java.io.File.getFreeSpace
</code></pre>

<p>I looked up the docs for getFreeSpace() and it says since API-9. 
As I understand froyo is compliant with API-8 (and above, I guess ?) 
so I sort of know (but do not quite understand) that I can not call this function on platform froyo, but I can call it on platforms above API-8</p>

<p><strong>So my Question / Ambiguity is this</strong></p>

<p>Given the application compiles perfectly fine, I would assume that function f.getFreeSpace() and its implementation is available in the jar of API-15 which I am using.
Why would android throw a runtime exception when my app is compiled with jar file of API-15 and it should have the implementation of getFreeSpace() in the jar ? Why would the platform Froyo - API-8 be causing a problem if implementation is there in the API-15 jar. ?</p>
