Hi, I am trying to create an Android TCP Server app with the PC as the
client. 'out.writeUTF("Hello!");' returns a "Hello!" on the PC client
side but the server app will always force close. I am using IP address
of '127.0.0.1' over at the client side.

This is all I get from 'adb logcat':
I/ActivityManager(   52): Process com.exercise.Serve (pid 297) has
died.
I/WindowManager(   52): WIN DEATH: Window{439564b8 com.exercise.Serve/
com.exercise.Serve.Serve paused=false}
W/UsageStats(   52): Unexpected resume of com.android.launcher while
already resumed in com.exercise.Serve
W/InputManagerService(   52): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub
$Proxy@43964838

Snippet of the Android Server app that I'm using:
''''
    Button.OnClickListener buttonSendOnClickListener
    = new Button.OnClickListener()
    {
        @Override
                public void onClick(View arg0)
            {
                    ServerSocket ss = null;
                        Socket s = null;
                        DataInputStream in = null;
                        DataOutputStream out = null;
                try
                {
                        ss = new ServerSocket(8888);
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                while(true)
                {
                        try
                        {
                                s = ss.accept();
                                in = new DataInputStream(s.getInputStream());
                                out = new DataOutputStream(s.getOutputStream());
                                out.writeUTF("Hello!");
                                 tv.append("S: Client connected" +
s.toString());
                                 tv.append("S: " + in.readUTF());
                                 setContentView(tv);
*and all the catch exceptions here*
''''
So can someone shed some light on this? Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to