Android server data fetch
<p>I want to fetch some data from a server protected with an username and password . I know both the username and password . Since the server is live , the data is continuing changing I need to fetch data every minute to update the application's status . The only function I know that can fetch data and turn it to a string is : </p>

<pre><code>private String getPage() {
            String str = "***";

            try
            {
                HttpClient hc = new DefaultHttpClient();
                HttpPost post = new HttpPost("http://mywebsite.me");
                HttpResponse rp = hc.execute(post);

                if(rp.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
                {
                    str = EntityUtils.toString(rp.getEntity());
                }
            }catch(IOException e){
                e.printStackTrace();
            }  

            return str;
        }
</code></pre>

<p>Since the server has a logon screen I don't know how to get pass it . So , i'd like help with 2 thigs :<strong>1.</strong> getting the data from the server and <strong>2.</strong> every 1 or 2 minutes I need to refresh my app and fetch again the data .</p>
