Added checking for null pointer exception in try catch block for connecting to server, it fixed the problem
of the app freezing when the server was not on the network
modified the layout to include both port and ip