登录
首页 » Android » [Android] 手机资料传到电脑(WiFi)

[Android] 手机资料传到电脑(WiFi)

于 2022-08-25 发布 文件大小:2.08 kB
0 124
下载积分: 2 下载次数: 1

代码说明:

如何将手机资料经由WIFI传到电脑呢?我们可以利用ServerSocket(Server端)和socket(Client端)来作一个例子,从手机裡选一张照片传送到电脑,这裡有一点要注意,Server和client需在同一个网址。电脑端(Server):先自订一个port(这裡是设成1111), 然后新建一个ServcerSocket,再呼叫accept()方法,这个方法会一直等到client端连进来,才会执行下一行程式。这边的build法,我是用eclipse,直接NEW->Java project,打入程式后,直接按RUN(Ctrl+F11)去执行,然后等待Android端连进来。Android端(Client):这边我设计成,程式一启动,就选一张照片传送到电脑端,分成二个阶段:第一个阶段时,new一个socket,然后带入Server端的IP位址及Port number,第二个阶段,先将照片读入后,存在buffer裡,然后在利用outputstream输出至Server端。最后,因为我们有用到网路传输,所以记得在xml加入INTERNET的权限。AndroidManifest.xml

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 讀取簡訊
    讀取簡訊
    2014-01-25下载
    积分:1
  • android菜单
    android界面跳转菜单,完整代码,希望对你们有帮助,主要有三个java文件,对应生成布局页面,菜单页面,所有布局都是对应layout的,所以封装性还好。 public class MyActivity extends Activity { private LinearLayout home_img_bn_Layout, style_img_bn_layout, cam_img_bn_layout, shopping_img_bn_layout, show_img_bn_layout; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE);
    2022-02-01 12:26:52下载
    积分:1
  • Orong_tbzs
    详细介绍 - [ 聚融网贷款投标助手源码 ] 聚融网贷款投标助手源码是一个安卓版本的聚融网贷款投标助手项目源码,一般公司或者开发者都不会把这类内部使用的项目源码泄漏出来,这个项目是依托于他的官网的orong.cn,但是现在官网挂掉了,估计整个公司跑路了才会分享出来,因为项目缺少部分图片资源所以原项目会报错,我使用资源目录下的其他图片文件对缺少的图片资源进行了替代,可能图片显示会有错误但是整个项目可以正常的运行起来(Detailed financial network loan tender assistant source] Poly financial loans Network Bidding Assistant source is an Android version of the fusion of the net loan bidding assistant project source code, companies or developers won t leak out the internal use of the project source code. The project is relying on his official website orong.cn, but now official website hang, it is estimated that the company running the will share out, because the items missing parts of the picture resources so the original project will misstatement, I use resource directory under the other picture file to replace the missing image resources may picture shows there will be mistakes but the entire project can be normal operation)
    2016-05-30 13:36:23下载
    积分:1
  • android 网络电话
    实现android网络客户端,13. 网络传来的音频数据通过AudioTrack类进行播放。14. 本地的音频数据通过AudioRecord类进行录制。15. 在本地播放数据包中的视频流,可以先提取位图,再显示。由于系统没有提供直接播放的相关方法。16. 线程同步的方法 – synchronized17. F:sipdroid esdrawable 中的图标可以更换 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2022-01-25 15:55:32下载
    积分:1
  • AndroidSMSFilter
    Android平台的短信过滤器,用广播实现,按照来电号码的前缀匹配是否需要过滤。做了前后台切换,用了ListActivity。(SMS filter for Android platform with broadcast, according to the Caller ID prefix match the need for filtering. Do Taiwan before and after the switch, with the ListActivity.)
    2013-03-06 20:19:05下载
    积分:1
  • android 转盘抽奖 实例源码
    android 转盘抽奖 实例源码
    2013-06-16下载
    积分:1
  • app
    说明:  掌握相册界面的开发,实现相册的立体与倒影效果(Grasp the development of album interface, realize the stereo and reflection effect of album)
    2020-06-16 08:20:02下载
    积分:1
  • Activity 的四种加载模式
    Activity 的四种加载模式 : 1、Standard: ActivityA   2、SingleTop: ActivityA    launchmode: SingleTop  ;    ActivityB    launchmode :Standard 3、SingleTask: ActivityA    launchmode: SingleTask;    ActivityB  launchmode : SingleTask 4、SingleInstance: ActivityA    launchmode: Standard;    ActivityB  launchmode : SingleInstance
    2022-07-07 14:24:24下载
    积分:1
  • Rtp2H264
    h264 RTP包的解包、拼帧源码,适合android平台,实测可用。(H264 RTP packet unpacking, fight the frame source, suitable for the android platform, the measured available.)
    2013-05-16 10:38:11下载
    积分:1
  • com.baidu.mapapi.overlay
    说明:  绘制百度地图的自我规划路线图,为百度地图演示(Self-planning road map for drawing Baidu map, demo for Baidu map)
    2019-03-14 12:18:58下载
    积分:1
  • 696518资源总数
  • 105877会员总数
  • 14今日下载