标签:android io ar os java sp 数据 on art
============问题描述============
class textDisitListener implements OnClickListener { public void onClick(View v) { new textDisThread().start(); } } class textDisThread extends Thread { public void run() { String str11 = new String("asdfasdf"); Log.i("socket","loading..."); try { Socket socketTest = new Socket(SERVERIP,SERVERPORT); Log.i("socket","load."); PrintWriter outw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socketTest.getOutputStream(),"GB2312")),true); outw.println(str11); Log.i("TextSend","textsend"); outw.flush(); outw.close(); socketTest.close(); } catch (UnknownHostException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } }
class btnListener implements OnClickListener { public void onClick(View v) { new textDisThread().start(); } } class textDisThread extends Thread { Socket socket1 = new Socket(SERVERIP,SERVERPORT); }
============解决方案1============
============解决方案2============
标签:android io ar os java sp 数据 on art
原文地址:http://www.cnblogs.com/meizhenfen42/p/4083133.html