好几天没有更新博客了,一来学校的课实在是太多了,以前以为能轻松点的。。 二来在实例操作的过程中又遇到不少的问题,还好都解决了。。。再来,就是没多久的C语言二级考试,擦,还有二十天估计,还没来的及看!!!!时间管理这方面自己还欠缺了~~废话就这么多,下面开始我们的实例演练。 还有 ...
好几天没有更新博客了,一来学校的课实在是太多了,以前以为能轻松点的。。 二来在实例操作的过程中又遇到不少的问题,还好都解决了。。。再来,就是没多久的C语言二级考试,擦,还有二十天估计,还没来的及看!!!!时间管理这方面自己还欠缺了~~废话就这么多,下面开始我们的实例演练。 还有 求大神给建议,新手来学习。
这方面的知识不是孤立的,其中有关于,Socket编程,多线程的操作,以及I/O流的操作。当然,实现方法不止一种,这只是其中一种,给同是新手一点点思路。如果有什么推荐的话,欢迎指点!
先给大家看一下应用程序的界面,基本就能知道大致的功能了。
图片大大的才好看。
activity_main.java
1 <LinearLayout ="http://schemas.android.com/apk/res/android" 2 ="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" 6 tools:context=".MainActivity"> 7 8 <EditText 9 android:id="@+id/editText"10 android:layout_width="match_parent"11 android:layout_height="wrap_content"12 android:hint="请输入要发送的内容"/>13 14 <Button15 android:id="@+id/button01"16 android:layout_width="match_parent"17 android:layout_height="wrap_content"18 android:text="连接"/>19 20 <Button21 android:id="@+id/button02"22 android:layout_width="match_parent"23 android:layout_height="wrap_content"24 android:text="发送"/>25 26 <ScrollView27 android:layout_width="match_parent"28 android:layout_height="wrap_content"29 android:scrollbars="vertical"30 android:fadingEdge="vertical">31 <TextView32 android:id="@+id/textView"33 android:layout_width="match_parent"34 android:layout_height="wrap_content"35 android:text="输出信息:"/>36 </ScrollView>37 38 </LinearLayout>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Android自学历程—Socket的简单使用
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。