this gots the error of os network on main thread exception.. how i resolve!?? i am using localhost server in permission i active that and still not working
public void GetText() throws UnsupportedEncodingException{
    String email = mEmailView.getText().toString();
    String password = mPasswordView.getText().toString();
    //urlTest = "http://localhost/php/projectsirius-the-rgstr/backoffice/login.php&id="+email;
    String data = URLEncoder.encode("email", "UTF-8")
            + "=" + URLEncoder.encode(email, "UTF-8");
    data += "&" + URLEncoder.encode("pass", "UTF-8")
            + "=" + URLEncoder.encode(password, "UTF-8");
    String text = "";
    BufferedReader reader=null;
    try
    {
        URL url = new URL("http://localhost/php/projectsirius-the-rgstr/backoffice/test.php");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        wr.write( data );
        wr.flush();
        // Get the server response
        reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        StringBuilder sb = new StringBuilder();
        String line = null;
        // Read Server Response
        while((line = reader.readLine()) != null)
        {
            // Append server response in string
            sb.append(line + "\n");
        }
        text = sb.toString();
    }
    catch(Exception e)
    {
        Log.e("error","ERROR" + e.toString());
    }
    finally
    {
        try
        {
            reader.close();
        }
        catch(Exception ex) {}
    }
    // Show response on activity
    content.setText( text  );
}
 
     
    