Error:failed to connect to/192.168.174(port 80) from/192.168.13(port 51342) after 1500msw

  android, java, javascript, jquery, php

guys i have an error about android studio when i debug my phone it shows me like that error that
i mentioned above. but when i debug emulator i works fine, whats the problem.

this is the code of log in,

lbl= (TextView) findViewById(R.id.lab);
log= (Button) findViewById(R.id.btnlog);
us= (EditText) findViewById(R.id.txtus);
pas= (EditText) findViewById(R.id.txtpas);
server=new Server();

public void log(View v){
    String tx;
    tx=us.getText().toString();
    try {
        data += "?&txtuser=" + URLEncoder.encode(us.getText().toString(), "UTF-8");
        data += "&txtpass=" + URLEncoder.encode(pas.getText().toString(), "UTF-8");
        String res= server.senddata("http://192.168.134.174/web7/logserver.php", data);
        if(res.equals("success")){
            Intent intent=new Intent(getApplicationContext(),Dash.class);
            intent.putExtra("user",tx);
            startActivity(intent);
        }
        else
        
        lbl.setText(res);
        
    }catch (Exception ex){
        Toast.makeText(Login.this, ex.getMessage(), Toast.LENGTH_SHORT).show();
    }
    us.setText("");
    pas.setText("");
}

Source: Android Questions

LEAVE A COMMENT