Android interacting with php
<p>I have a problem! I have a connection with a php page to connect with database and the method works fine on Froyo, but doesn't work on newer versions of Android. What is the problem?</p>

<pre><code>        public static String interact(String request){
            String result="test";
        String site = "http://xxxx.net:nnn/xxx";
        URL url = new URL(site);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();

        connection.setRequestMethod("POST");
        connection.setDoOutput(true);
        connection.connect();

        OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
        wr.write(request);
        wr.flush();
        wr.close();

        Scanner in = new Scanner(connection.getInputStream());
        while(in.hasNextLine())
        result+=in.nextLine();
        connection.disconnect();
        return result;

    }
    catch (UnknownHostException e) {
        return e.getMessage();
    } catch (IOException ex) {
        return ex.getMessage();
    }
    catch (Exception ex){
        return ex.getMessage();
    }

}   
</code></pre>

<p>I need to send data and get response, but it just gives me null on newer Android than 2.2.</p>
