Android Giving null value from the server
<p>hi in my application i send request to the server.On first call it gives me null values,after that it gives me value.Why i am getting null please help me.My code is.HttpUtilities class contain request method.</p>

<pre><code>public class WebUtilities
{
private static HttpClient client = new DefaultHttpClient();     
private static HttpGet    request;
public static String getRequest(String strURL)
{
    String Result = " ";
    request = new HttpGet(strURL);
    try
    {
        HttpResponse response = client.execute(request);
        if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK)
            Result = new HttpUtilities().request(response);
        else
            Result = null;
    }
    catch (Exception ex)
    {
        Result = null;
    }
    return Result;
}
}
 public String request(HttpResponse response)
{
    try
    {
        InputStream in = response.getEntity().getContent();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        StringBuilder str = new StringBuilder();
        String line = null;
        while ((line = reader.readLine()) != null)
        {
            str.append(line);
            str.append("\n");
        }
        in.close();

        result = str.toString();

    }
    catch (Exception ex)
    {
        result = "";
    }
    return result;
}
</code></pre>
