Wait Until Browser Has Loaded Page, Clear Cache
<p>I am trying to write an android app to test performance and battery life of a phone.  I am trying to do the following:</p>

<pre><code>//start timing
//open browser to web page (using intent)
//wait for browser to finish loading page
//stop timing
//calculate total time, write to file
//clear browser cache
//repeat until battery dies
</code></pre>

<p>My questions is, how can I tell when the page has loaded?  I have seen a few mentions of javascript, but I haven't seen a good example to understand how I can integrate that into my app (or even if that is the best idea for what I want to accomplish).</p>

<p>My second question is, how can I clear the browser's cache?  Preventing the browser from loading from cache is also a possible solution.</p>
