I want my app to connect to a server. I only want the client.
protected void onCreate(Bundle savedInstanceState) {
//...
try {
InetAddress serverAddr = InetAddress.getByName(serverIpAddress);
socket = new Socket(serverAddr, REDIRECTED_SERVERPORT);
} catch (UnknownHostException e1) {
//...
} catch (IOException e1) {
//...
}
}
But the application just crashes. I started this activity by pressing a button. Do you know what the problem could be?