You are probably getting Network on UI thread error, and because it is in a try catch, the app isnt crashing
you are supposed to invoke network operations only in background threads, or AsyncTasks which are great for that
there is nothing wrong with your HTTP client and request data, the problem indeed lies in your onCreate method
try rewriting it this way
public class MainActivity extends Activity {
TextView httpStuff;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
httpStuff = (TextView) findViewById(R.id.tvHttp);
AsyncTask<Void,Void,String>getDataTask = new AsyncTask<Void,Void,String>(){
@Override
protected String doInBackground(Void... params){
GetMethodEx test = new GetMethodEx();
String returned = test.getInternalData();
return returned;
}
@Override
protected void onPostExecute(String returned){
httpStuff.setText(returned);
}
}
}
getDataTask.execute();
}