既然是使用SOCKET连接网络上的电脑,就分为两部分 其一,Android上面的Client 其二,PC上的Server Android上面的实现代码如下 package Hello.MySocket; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.Socket; import java.net.UnknownHostException; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MySocket extends Activity { private final String DEBUG_TAG="lengfeng"; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Log.v("lengfeng","Android Start Connect");