服务端的EXE程序在文章:http://www.shijieweb.cn/post/1cc4ef53_40fc277中.
此文描述ANDROID客户端相关代码.
JAVA客户端DEMO代码:
new SendPcLog(log).start();
package cn.sj.soft;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;import
java.net.SocketTimeoutException;
import java.net.URLEncoder;
/**
* 发送日志文件到PC 定位错误 android
* @author zw
*/
public class SendPcLog extends Thread {
private static String HOST = "192.168.1.88";
private static int PORT = 19730;
static String buffer = "";
static Socket socket = null;
public String txt1;
public SendPcLog(String str) {
txt1 = android.os.Build.MODEL+":"+str;
}
@Override
public void run() {
//定义消息
try {