Android TCP Socket通信实例Demo源码Apk下载

上传者: daokedream | 上传时间: 2021-03-13 15:08:44 | 文件大小: 738KB | 文件类型: ZIP
最近有个项目模块需要用到TCP Socket通讯,遇到了一个大坑,所以做了这个Demo。 本Demo主要实现了安卓(Android)TCP 客户端(Client)和服务器(Server)Demo的Socket通讯。以及对接硬件的项目数据在十六进制&&byte&&int的转换处理。 要注意BufferedReader的readLine()方法的阻塞问题: 读取socket输入流的时候很多代码都会这么写,一般也不会有什么问题,但是readLine()方法读取不到换行和回车时会阻塞! String line = null; while ((line = br.readLine()) != null) { } 具体可以先查看博文:https://blog.csdn.net/daokedream/article/details/113918467,欢迎交流。

文件下载

资源详情

[{"title":"( 47 个子文件 738KB ) Android TCP Socket通信实例Demo源码Apk下载","children":[{"title":"TCPDemo","children":[{"title":"gradlew <span style='color:#111;'> 5.34KB </span>","children":null,"spread":false},{"title":"settings.gradle <span style='color:#111;'> 44B </span>","children":null,"spread":false},{"title":".idea","children":[{"title":"runConfigurations.xml <span style='color:#111;'> 575B </span>","children":null,"spread":false},{"title":"misc.xml <span style='color:#111;'> 365B </span>","children":null,"spread":false},{"title":"gradle.xml <span style='color:#111;'> 649B </span>","children":null,"spread":false},{"title":"codeStyles","children":[{"title":"Project.xml <span style='color:#111;'> 3.34KB </span>","children":null,"spread":false}],"spread":true},{"title":"vcs.xml <span style='color:#111;'> 188B </span>","children":null,"spread":false}],"spread":true},{"title":"gradle","children":[{"title":"wrapper","children":[{"title":"gradle-wrapper.properties <span style='color:#111;'> 238B </span>","children":null,"spread":false},{"title":"gradle-wrapper.jar <span style='color:#111;'> 53.06KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"gradlew.bat <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"gradle.properties <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 222B </span>","children":null,"spread":false},{"title":"app","children":[{"title":"src","children":[{"title":"androidTest","children":[{"title":"java","children":[{"title":"com","children":[{"title":"crazy","children":[{"title":"tcpdemo","children":[{"title":"ExampleInstrumentedTest.java <span style='color:#111;'> 750B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"crazy","children":[{"title":"tcpdemo","children":[{"title":"ExampleUnitTest.java <span style='color:#111;'> 379B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 893B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"mipmap-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.89KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 4.79KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 8.91KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 14.78KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 4.38KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 6.73KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-anydpi-v26","children":[{"title":"ic_launcher.xml <span style='color:#111;'> 276B </span>","children":null,"spread":false},{"title":"ic_launcher_round.xml <span style='color:#111;'> 276B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.01KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 2.72KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable","children":[{"title":"ic_launcher_background.xml <span style='color:#111;'> 5.64KB </span>","children":null,"spread":false}],"spread":false},{"title":"layout","children":[{"title":"item_log.xml <span style='color:#111;'> 306B </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 7.84KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-v24","children":[{"title":"ic_launcher_foreground.xml <span style='color:#111;'> 1.87KB </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"colors.xml <span style='color:#111;'> 214B </span>","children":null,"spread":false},{"title":"strings.xml <span style='color:#111;'> 73B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 394B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 216B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 6.24KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 10.17KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"java","children":[{"title":"com","children":[{"title":"crazy","children":[{"title":"tcpdemo","children":[{"title":"TcpClient.java <span style='color:#111;'> 6.32KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 22.81KB </span>","children":null,"spread":false},{"title":"IntByteStringHexUtil.java <span style='color:#111;'> 3.08KB </span>","children":null,"spread":false},{"title":"TcpServer.java <span style='color:#111;'> 8.07KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"doc","children":[{"title":"tcpdemo.gif <span style='color:#111;'> 498.82KB </span>","children":null,"spread":false},{"title":"readme <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"1.png <span style='color:#111;'> 33.43KB </span>","children":null,"spread":false},{"title":"2.png <span style='color:#111;'> 92.59KB </span>","children":null,"spread":false}],"spread":true},{"title":".gitignore <span style='color:#111;'> 8B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 954B </span>","children":null,"spread":false},{"title":"proguard-rules.pro <span style='color:#111;'> 772B </span>","children":null,"spread":false}],"spread":true},{"title":"build.gradle <span style='color:#111;'> 585B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • 沐夏曦ღ :
    用户下载后在一定时间内未进行评价,系统默认好评。
    2021-08-06
  • Oπ :
    用户下载后在一定时间内未进行评价,系统默认好评。
    2021-08-01
  • weixin_42621819 :
    用户下载后在一定时间内未进行评价,系统默认好评。
    2021-07-23
  • 【小白】- :
    用户下载后在一定时间内未进行评价,系统默认好评。
    2021-07-10
  • weixin_51404991 :
    用户下载后在一定时间内未进行评价,系统默认好评。
    2021-06-28

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明