├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml └── misc.xml ├── License ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── mars │ │ └── socket │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mars │ │ │ └── socket │ │ │ ├── MainSocketClient.java │ │ │ ├── MainSocketServer.java │ │ │ ├── SocketClient.java │ │ │ ├── SocketServer.java │ │ │ └── Switch_main.java │ └── res │ │ ├── drawable │ │ └── button_style_blue.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── activity_switch_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── mars │ └── socket │ └── ExampleUnitTest.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.gitignore -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.idea/compiler.xml -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.idea/copyright/profiles_settings.xml -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.idea/encodings.xml -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.idea/gradle.xml -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/.idea/misc.xml -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/License -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # socket 2 | 使用socket实现两个真机之间的通信 3 | 4 | #博客网址 5 | https://blog.csdn.net/guang_liang_/article/details/52853134 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/build.gradle -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/proguard-rules.pro -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mars/socket/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/androidTest/java/com/mars/socket/ExampleInstrumentedTest.java -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/AndroidManifest.xml -------------------------------------------------------------------------------- /app/src/main/java/com/mars/socket/MainSocketClient.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/java/com/mars/socket/MainSocketClient.java -------------------------------------------------------------------------------- /app/src/main/java/com/mars/socket/MainSocketServer.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/java/com/mars/socket/MainSocketServer.java -------------------------------------------------------------------------------- /app/src/main/java/com/mars/socket/SocketClient.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/java/com/mars/socket/SocketClient.java -------------------------------------------------------------------------------- /app/src/main/java/com/mars/socket/SocketServer.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/java/com/mars/socket/SocketServer.java -------------------------------------------------------------------------------- /app/src/main/java/com/mars/socket/Switch_main.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/java/com/mars/socket/Switch_main.java -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_style_blue.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/drawable/button_style_blue.xml -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/layout/activity_main.xml -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_switch_main.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/layout/activity_switch_main.xml -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/values-w820dp/dimens.xml -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/values/colors.xml -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/values/dimens.xml -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/values/strings.xml -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/main/res/values/styles.xml -------------------------------------------------------------------------------- /app/src/test/java/com/mars/socket/ExampleUnitTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/app/src/test/java/com/mars/socket/ExampleUnitTest.java -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/gradle.properties -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/gradle/wrapper/gradle-wrapper.properties -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/gradlew -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-wgl/socket/HEAD/gradlew.bat -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------