i got a very unusual problem as my application works fine on emulator in which i'm using java socket programming to connect android device with server pc....but when i install my .apk file in my android mobile it gets crash...it does not connect with my server PC ....
please suggest some solutions why this is happening...i'm posting my socket code here...

```
try {
        socket = new Socket(InetAddress.getByName("vivek-PC")
                .getHostAddress(), 8888);

        dataOutputStream = new DataOutputStream(socket.getOutputStream());
        dataInputStream = new DataInputStream(socket.getInputStream());
    } catch (UnknownHostException e) {
        // textIn.setText("Button Clicked" + e);
        e.printStackTrace();
    } catch (IOException e) {

        e.printStackTrace();

    }

```

i have tried both way to put hostname as well as my serverIP address bt same result i get/....works fine on emulator and get crashed on device...
please reply soon..