Coder Social home page Coder Social logo

androidwifisocket-'s Introduction

AndroidWifiSocket-

使用wifi实现手机之间的和文件传输

功能已实现,代码需自己封装代码,Socket通讯可使用到电脑端,属于通用型

文中使用两个Socket进行通讯,两Socket进行文件的传输,具体操作代码中有注释

private SocketUtils sockerServer;//本机的服务(通讯使用)

private SocketUtils sockerClient;//连接远程的服务(通讯使用)

private FileClient fileClient;//上传文件的服务

private FileServer fileServer;//接收文件的服务

文中使用两个Socket进行通讯,两Socket进行文件的传输,具体操作代码中有注释

private void scanDevice()//开始扫描同一网段下的IP,并测试是否有可用的拿到可以用的Socket

private void connentSocket(Socket socket);//开始连接远程手机的Socket获取设备的型号和Android版本

private String getServerInfo(String msg);//本方法是服务端调用的,用于辨别客户端请求的意图做出对应的操作

private boolean openFileServer();//打开一个接收文件的Socket服务

SocketUtils.setMessageListener();//设置会话的监听

private void sendFile(final String path) ;//发送一个文件

public SocketUtils(int port);//作为服务端

public SocketUtils(String host,int port);//作为客户端

androidwifisocket-'s People

Contributors

zcs0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.