资源简介
RunMap 一个简单的运动跑步App
代码片段和文件信息
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.atomic.AtomicLong;
/**
* Created by chen on 2017/7/15.
*/
public class LogServer {
public static void main(String []args){
try {
ServerSocket serverSocket = new ServerSocket(9090);
AtomicLong mCountLogs = new AtomicLong(0);
while (true) {
System.out.println(“start write log“+serverSocket.getLocalSocketAddress().toString());
Socket socket = serverSocket.accept();
System.out.println(“start write log“);
new Thread(new LogWriter(mCountLogs.getAndDecrement() socket)).start();
}
} catch (IOException e) {
e.printStackTrace();
}
}
static class LogWriter implements Runnable{
private long mLogSerial;
private Socket mSocket;
public LogWriter(long logSerialSocket socket) {
this.mLogSerial = logSerial;
this.mSocket = socket;
}
@Override
public void run() {
try {
File destLogFile = new File(“D:\\logs“+mLogSerial+“.txt“);
destLogFile.createNewFile();
InputStream ins = mSocket.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(ins));
OutputStream outputStream = new FileOutputStream(destLogFile);
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream));
String line;
while(mSocket.isConnected() && (line = reader.readLine()) != null){
System.out.println(“line is “ +line);
writer.write(line);
}
reader.close();
writer.flush();
writer.close();
System.out.println(“end write log“);
} catch (IOException e) {
e.printStackTrace();
}
finally {
try {
mSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\
文件 199 2017-08-23 15:43 skyinu-RunMap-3180456\.gitignore
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\
文件 686 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\compiler.xm
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\copyright\
文件 74 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\copyright\profiles_settings.xm
文件 159 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\encodings.xm
文件 2044 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\misc.xm
文件 564 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\runConfigurations.xm
文件 180 2017-08-23 15:43 skyinu-RunMap-3180456\.idea\vcs.xm
文件 11357 2017-08-23 15:43 skyinu-RunMap-3180456\LICENSE
文件 2237 2017-08-23 15:43 skyinu-RunMap-3180456\LogServer.java
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\
文件 41 2017-08-23 15:43 skyinu-RunMap-3180456\app\.gitignore
文件 2625 2017-08-23 15:43 skyinu-RunMap-3180456\app\build.gradle
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\
文件 3201976 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\AMap3DMap_5.1.0_AMapSearch_5.1.0_AMapLocation_3.4.0_20170518.jar
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\
文件 132168 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libGNaviData.so
文件 549916 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libGNaviMap.so
文件 228572 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libGNaviMapex.so
文件 42056 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libGNaviSearch.so
文件 431444 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libGNaviUtils.so
文件 177272 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libRoadLineRebuildAPI.so
文件 9584 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\armeabi-v7a\libconfig.so
文件 86002 2017-08-23 15:43 skyinu-RunMap-3180456\app\libs\wechat-sdk-android-without-mta-1.0.2.jar
文件 1391 2017-08-23 15:43 skyinu-RunMap-3180456\app\proguard-rules.pro
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\src\
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\src\androidTest\
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\src\androidTest\java\
目录 0 2017-08-23 15:43 skyinu-RunMap-3180456\app\src\androidTest\java\com\
............此处省略283个文件信息
评论
共有 条评论