ENETUNREACH (Network is unreachable) error? What am I doing wroung?
<p>I am attempting to establish a connection with android and my server. My server sends HTML5 responses. </p>

<p>My main activity </p>

<pre><code>public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        //atempting connection to sever
        Thread thread = new Thread(new Runnable(){
            @Override
            public void run() {
                try {
                    SimpleHTTPRequest connect=new SimpleHTTPRequest();
                    connect.attemptConnect();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });

        thread.start();



        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}
</code></pre>

<p>My network class </p>

<pre><code>public class SimpleHTTPRequest {
HttpURLConnection connection = null;
BufferedReader rd = null;
StringBuilder sb = null;
String line = null;

public void attemptConnect() {

    try {
        URL serverAddress = new URL("myUrl");
        //set up out communications stuff
        connection = null;

        //Set up the initial connection
        connection = (HttpURLConnection) serverAddress.openConnection();
        connection.setRequestMethod("GET");
        connection.connect();

        //get the output stream writer and write the output to the server
        //not needed in this example
        //wr = new OutputStreamWriter(connection.getOutputStream());
        //wr.write("");
        //wr.flush();
        //read the result from the server
        rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
        sb = new StringBuilder();

        while ((line = rd.readLine()) != null) {
            sb.append(line + '\n');
            System.out.println(sb.toString());
            //This will return the String Server Sent event from the server
            //Need to parse the data as JSON Now
            //attempt to parse string from sb=StringBuilder into a JSon object
        }



    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (ProtocolException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        //close the connection, set all objects to null
        connection.disconnect();
        rd = null;
        sb = null;
        connection = null;
    }
}
}
</code></pre>

<p>I did this in eclipse and it worked, so what am I doing wroung? </p>