On ICS and later you cannot do network operations on the UI thread anymore. Instead you are forced to create a new thread and do your networking stuff there.
Possible tools are Android’s AsyncTask
and the normal Java Thread
.
A good tutorial can be found here: Android Threads, Handlers and AsyncTask – Tutorial